aboutsummaryrefslogtreecommitdiff
path: root/src/rpc
diff options
context:
space:
mode:
authorassylias <yann@assylias.com>2017-03-28 15:55:38 +0100
committerassylias <yann@assylias.com>2017-04-19 18:28:16 +0100
commitbff90264b8b4e3869aad92e09591f2a579504d7e (patch)
tree5243440af48edc6f623baf3b16cdf4773797b931 /src/rpc
parentMerge pull request #1956 (diff)
downloadmonero-bff90264b8b4e3869aad92e09591f2a579504d7e.tar.xz
Add expected total reward to RPC "getblocktemplate".
Only works from V5 fork onward - returns 0 before that block.
Diffstat (limited to 'src/rpc')
-rw-r--r--src/rpc/core_rpc_server.cpp2
-rw-r--r--src/rpc/core_rpc_server_commands_defs.h4
2 files changed, 4 insertions, 2 deletions
diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp
index 7cce0bf04..76a69fbf6 100644
--- a/src/rpc/core_rpc_server.cpp
+++ b/src/rpc/core_rpc_server.cpp
@@ -883,7 +883,7 @@ namespace cryptonote
block b = AUTO_VAL_INIT(b);
cryptonote::blobdata blob_reserve;
blob_reserve.resize(req.reserve_size, 0);
- if(!m_core.get_block_template(b, acc, res.difficulty, res.height, blob_reserve))
+ if(!m_core.get_block_template(b, acc, res.difficulty, res.height, res.expected_reward, blob_reserve))
{
error_resp.code = CORE_RPC_ERROR_CODE_INTERNAL_ERROR;
error_resp.message = "Internal error: failed to create block template";
diff --git a/src/rpc/core_rpc_server_commands_defs.h b/src/rpc/core_rpc_server_commands_defs.h
index 3991fc27b..9bdadf0d1 100644
--- a/src/rpc/core_rpc_server_commands_defs.h
+++ b/src/rpc/core_rpc_server_commands_defs.h
@@ -49,7 +49,7 @@ namespace cryptonote
// advance which version they will stop working with
// Don't go over 32767 for any of these
#define CORE_RPC_VERSION_MAJOR 1
-#define CORE_RPC_VERSION_MINOR 9
+#define CORE_RPC_VERSION_MINOR 10
#define MAKE_CORE_RPC_VERSION(major,minor) (((major)<<16)|(minor))
#define CORE_RPC_VERSION MAKE_CORE_RPC_VERSION(CORE_RPC_VERSION_MAJOR, CORE_RPC_VERSION_MINOR)
@@ -692,6 +692,7 @@ namespace cryptonote
uint64_t difficulty;
uint64_t height;
uint64_t reserved_offset;
+ uint64_t expected_reward;
std::string prev_hash;
blobdata blocktemplate_blob;
blobdata blockhashing_blob;
@@ -701,6 +702,7 @@ namespace cryptonote
KV_SERIALIZE(difficulty)
KV_SERIALIZE(height)
KV_SERIALIZE(reserved_offset)
+ KV_SERIALIZE(expected_reward)
KV_SERIALIZE(prev_hash)
KV_SERIALIZE(blocktemplate_blob)
KV_SERIALIZE(blockhashing_blob)