aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/core_rpc_server.cpp
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-10-15 15:00:21 +0100
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-10-15 15:00:21 +0100
commit5e10fb042dea8e941cc2d978eb72a9c590b8c953 (patch)
tree7e6375b3fb3e8d11066947864da2ec49beb99326 /src/rpc/core_rpc_server.cpp
parentMerge pull request #1203 (diff)
downloadmonero-5e10fb042dea8e941cc2d978eb72a9c590b8c953.tar.xz
rpc: add blockchain cumulative difficulty to getinfo call
Diffstat (limited to 'src/rpc/core_rpc_server.cpp')
-rw-r--r--src/rpc/core_rpc_server.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp
index e8b2d5cb1..0a669e0b5 100644
--- a/src/rpc/core_rpc_server.cpp
+++ b/src/rpc/core_rpc_server.cpp
@@ -142,6 +142,7 @@ namespace cryptonote
res.white_peerlist_size = m_p2p.get_peerlist_manager().get_white_peers_count();
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.status = CORE_RPC_STATUS_OK;
return true;
}
@@ -1105,6 +1106,7 @@ namespace cryptonote
res.white_peerlist_size = m_p2p.get_peerlist_manager().get_white_peers_count();
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.status = CORE_RPC_STATUS_OK;
return true;
}