aboutsummaryrefslogtreecommitdiff
path: root/src/rpc
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-01-17 10:47:05 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-01-17 11:12:26 +0000
commit42f86624a301854ea2b5902637c89ffdcfdf770f (patch)
treebe52bddc839ee2c977aded5b55647a44c9e68528 /src/rpc
parentMerge pull request #3091 (diff)
downloadmonero-42f86624a301854ea2b5902637c89ffdcfdf770f.tar.xz
rpc: expose recent median block size in getinfo
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, 5 insertions, 1 deletions
diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp
index 4966b107d..f540bad91 100644
--- a/src/rpc/core_rpc_server.cpp
+++ b/src/rpc/core_rpc_server.cpp
@@ -153,6 +153,7 @@ namespace cryptonote
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.block_size_median = m_core.get_blockchain_storage().get_current_cumulative_blocksize_median();
res.status = CORE_RPC_STATUS_OK;
res.start_time = (uint64_t)m_core.get_start_time();
res.free_space = m_restricted ? std::numeric_limits<uint64_t>::max() : m_core.get_free_space();
@@ -1339,6 +1340,7 @@ namespace cryptonote
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.block_size_median = m_core.get_blockchain_storage().get_current_cumulative_blocksize_median();
res.status = CORE_RPC_STATUS_OK;
res.start_time = (uint64_t)m_core.get_start_time();
res.free_space = m_restricted ? std::numeric_limits<uint64_t>::max() : m_core.get_free_space();
diff --git a/src/rpc/core_rpc_server_commands_defs.h b/src/rpc/core_rpc_server_commands_defs.h
index ad0bff077..8280fea7c 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 17
+#define CORE_RPC_VERSION_MINOR 18
#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)
@@ -926,6 +926,7 @@ namespace cryptonote
std::string top_block_hash;
uint64_t cumulative_difficulty;
uint64_t block_size_limit;
+ uint64_t block_size_median;
uint64_t start_time;
uint64_t free_space;
bool offline;
@@ -948,6 +949,7 @@ namespace cryptonote
KV_SERIALIZE(top_block_hash)
KV_SERIALIZE(cumulative_difficulty)
KV_SERIALIZE(block_size_limit)
+ KV_SERIALIZE(block_size_median)
KV_SERIALIZE(start_time)
KV_SERIALIZE(free_space)
KV_SERIALIZE(offline)