aboutsummaryrefslogtreecommitdiff
path: root/src/rpc
diff options
context:
space:
mode:
authormonero-project <sempre.amaro@gmail.com>2014-06-05 10:11:07 -0400
committermonero-project <sempre.amaro@gmail.com>2014-06-05 10:11:07 -0400
commit3162fcb70fa609eebfcb1cac004041fbca37a7cc (patch)
tree74041dbb25e23a7b65cc6a32d6d3489c114d8e4c /src/rpc
parent4492317603b73ed0d1a447b7916d228bd62358fd (diff)
parentde76efe9fe08cb649de661fe1a1211cf016cab87 (diff)
downloadmonzero-core-3162fcb70fa609eebfcb1cac004041fbca37a7cc.tar.gz
monzero-core-3162fcb70fa609eebfcb1cac004041fbca37a7cc.tar.xz
monzero-core-3162fcb70fa609eebfcb1cac004041fbca37a7cc.zip
Merge pull request #24 from Neozaru/master
'getinfo' daemon HTTP-RPC returns 'target_height' for progress estimation
Diffstat (limited to 'src/rpc')
-rw-r--r--src/rpc/core_rpc_server.cpp1
-rw-r--r--src/rpc/core_rpc_server_commands_defs.h2
2 files changed, 3 insertions, 0 deletions
diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp
index e4a7c9773..03af66f4f 100644
--- a/src/rpc/core_rpc_server.cpp
+++ b/src/rpc/core_rpc_server.cpp
@@ -81,6 +81,7 @@ namespace cryptonote
{
CHECK_CORE_BUSY();
res.height = m_core.get_current_blockchain_height();
+ res.target_height = m_core.get_target_blockchain_height();
res.difficulty = m_core.get_blockchain_storage().get_difficulty_for_next_block();
res.tx_count = m_core.get_blockchain_storage().get_total_transactions() - res.height; //without coinbase
res.tx_pool_size = m_core.get_pool_transactions_count();
diff --git a/src/rpc/core_rpc_server_commands_defs.h b/src/rpc/core_rpc_server_commands_defs.h
index 48df16e59..6e87fb48c 100644
--- a/src/rpc/core_rpc_server_commands_defs.h
+++ b/src/rpc/core_rpc_server_commands_defs.h
@@ -214,6 +214,7 @@ namespace cryptonote
{
std::string status;
uint64_t height;
+ uint64_t target_height;
uint64_t difficulty;
uint64_t tx_count;
uint64_t tx_pool_size;
@@ -226,6 +227,7 @@ namespace cryptonote
BEGIN_KV_SERIALIZE_MAP()
KV_SERIALIZE(status)
KV_SERIALIZE(height)
+ KV_SERIALIZE(target_height)
KV_SERIALIZE(difficulty)
KV_SERIALIZE(tx_count)
KV_SERIALIZE(tx_pool_size)