aboutsummaryrefslogtreecommitdiff
path: root/src/rpc
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-01-08 11:14:11 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-01-13 23:21:38 +0000
commit5b5017e26708c48cc1ba7bd3f1e0f0f70d6c6316 (patch)
tree6560c7f8c0177766d1ae0d276bd7de0742972211 /src/rpc
parentMerge pull request #1562 (diff)
downloadmonero-5b5017e26708c48cc1ba7bd3f1e0f0f70d6c6316.tar.xz
rpc: add a command to get info about the current blockchain
About the tip of the main chain, and the last N blocks
Diffstat (limited to 'src/rpc')
-rw-r--r--src/rpc/core_rpc_server.cpp1
-rw-r--r--src/rpc/core_rpc_server_commands_defs.h4
2 files changed, 4 insertions, 1 deletions
diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp
index ddf892cae..fc93b3a51 100644
--- a/src/rpc/core_rpc_server.cpp
+++ b/src/rpc/core_rpc_server.cpp
@@ -896,6 +896,7 @@ namespace cryptonote
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);
+ response.num_txes = blk.tx_hashes.size();
return true;
}
//------------------------------------------------------------------------------------------------------------------------------
diff --git a/src/rpc/core_rpc_server_commands_defs.h b/src/rpc/core_rpc_server_commands_defs.h
index fa86c08e4..49de94ad9 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 4
+#define CORE_RPC_VERSION_MINOR 5
#define CORE_RPC_VERSION (((CORE_RPC_VERSION_MAJOR)<<16)|(CORE_RPC_VERSION_MINOR))
struct COMMAND_RPC_GET_HEIGHT
@@ -706,6 +706,7 @@ namespace cryptonote
difficulty_type difficulty;
uint64_t reward;
uint64_t block_size;
+ uint64_t num_txes;
BEGIN_KV_SERIALIZE_MAP()
KV_SERIALIZE(major_version)
@@ -720,6 +721,7 @@ namespace cryptonote
KV_SERIALIZE(difficulty)
KV_SERIALIZE(reward)
KV_SERIALIZE(block_size)
+ KV_SERIALIZE(num_txes)
END_KV_SERIALIZE_MAP()
};