diff options
author | Riccardo Spagni <ric@spagni.net> | 2017-01-08 16:43:54 -0800 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2017-01-08 16:43:54 -0800 |
commit | 15dcc5afd3135ee1e38da05b88c01b94dee5786f (patch) | |
tree | 8ee929dc3bb6defeda744eb4023a8ff33a1b9617 /src/rpc | |
parent | Merge pull request #1531 (diff) | |
parent | tx_pool: better block template filling algorithm (diff) | |
download | monero-15dcc5afd3135ee1e38da05b88c01b94dee5786f.tar.xz |
Merge pull request #1534
1607cb7e tx_pool: better block template filling algorithm (moneromooo-monero)
9731b4e5 rpc: add block size to GET_BLOCK_HEADER RPC (moneromooo-monero)
9188b346 rpc: add current block size to the getinfo call (moneromooo-monero)
Diffstat (limited to 'src/rpc')
-rw-r--r-- | src/rpc/core_rpc_server.cpp | 3 | ||||
-rw-r--r-- | src/rpc/core_rpc_server_commands_defs.h | 6 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp index c2ff63fc7..6ca01ed2c 100644 --- a/src/rpc/core_rpc_server.cpp +++ b/src/rpc/core_rpc_server.cpp @@ -143,6 +143,7 @@ namespace cryptonote res.grey_peerlist_size = m_p2p.get_peerlist_manager().get_gray_peers_count(); res.testnet = m_testnet; res.cumulative_difficulty = m_core.get_blockchain_storage().get_db().get_block_cumulative_difficulty(res.height - 1); + res.block_size_limit = m_core.get_blockchain_storage().get_current_cumulative_blocksize_limit(); res.status = CORE_RPC_STATUS_OK; return true; } @@ -891,6 +892,7 @@ namespace cryptonote response.hash = string_tools::pod_to_hex(hash); response.difficulty = m_core.get_blockchain_storage().block_difficulty(height); response.reward = get_block_reward(blk); + response.block_size = m_core.get_blockchain_storage().get_db().get_block_size(height); return true; } //------------------------------------------------------------------------------------------------------------------------------ @@ -1161,6 +1163,7 @@ namespace cryptonote res.grey_peerlist_size = m_p2p.get_peerlist_manager().get_gray_peers_count(); res.testnet = m_testnet; res.cumulative_difficulty = m_core.get_blockchain_storage().get_db().get_block_cumulative_difficulty(res.height - 1); + res.block_size_limit = m_core.get_blockchain_storage().get_current_cumulative_blocksize_limit(); res.status = CORE_RPC_STATUS_OK; return true; } diff --git a/src/rpc/core_rpc_server_commands_defs.h b/src/rpc/core_rpc_server_commands_defs.h index 6060cee3a..c08e43066 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 0 +#define CORE_RPC_VERSION_MINOR 3 #define CORE_RPC_VERSION (((CORE_RPC_VERSION_MAJOR)<<16)|(CORE_RPC_VERSION_MINOR)) struct COMMAND_RPC_GET_HEIGHT @@ -512,6 +512,7 @@ namespace cryptonote bool testnet; std::string top_block_hash; uint64_t cumulative_difficulty; + uint64_t block_size_limit; BEGIN_KV_SERIALIZE_MAP() KV_SERIALIZE(status) @@ -529,6 +530,7 @@ namespace cryptonote KV_SERIALIZE(testnet) KV_SERIALIZE(top_block_hash) KV_SERIALIZE(cumulative_difficulty) + KV_SERIALIZE(block_size_limit) END_KV_SERIALIZE_MAP() }; }; @@ -693,6 +695,7 @@ namespace cryptonote std::string hash; difficulty_type difficulty; uint64_t reward; + uint64_t block_size; BEGIN_KV_SERIALIZE_MAP() KV_SERIALIZE(major_version) @@ -706,6 +709,7 @@ namespace cryptonote KV_SERIALIZE(hash) KV_SERIALIZE(difficulty) KV_SERIALIZE(reward) + KV_SERIALIZE(block_size) END_KV_SERIALIZE_MAP() }; |