mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-11-26 21:03:28 +01:00
rpc: add blockchain cumulative difficulty to getinfo call
This commit is contained in:
parent
34fcfcd7cc
commit
5e10fb042d
@ -142,6 +142,7 @@ namespace cryptonote
|
|||||||
res.white_peerlist_size = m_p2p.get_peerlist_manager().get_white_peers_count();
|
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.grey_peerlist_size = m_p2p.get_peerlist_manager().get_gray_peers_count();
|
||||||
res.testnet = m_testnet;
|
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;
|
res.status = CORE_RPC_STATUS_OK;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -1105,6 +1106,7 @@ namespace cryptonote
|
|||||||
res.white_peerlist_size = m_p2p.get_peerlist_manager().get_white_peers_count();
|
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.grey_peerlist_size = m_p2p.get_peerlist_manager().get_gray_peers_count();
|
||||||
res.testnet = m_testnet;
|
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;
|
res.status = CORE_RPC_STATUS_OK;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -464,6 +464,7 @@ namespace cryptonote
|
|||||||
uint64_t grey_peerlist_size;
|
uint64_t grey_peerlist_size;
|
||||||
bool testnet;
|
bool testnet;
|
||||||
std::string top_block_hash;
|
std::string top_block_hash;
|
||||||
|
uint64_t cumulative_difficulty;
|
||||||
|
|
||||||
BEGIN_KV_SERIALIZE_MAP()
|
BEGIN_KV_SERIALIZE_MAP()
|
||||||
KV_SERIALIZE(status)
|
KV_SERIALIZE(status)
|
||||||
@ -480,6 +481,7 @@ namespace cryptonote
|
|||||||
KV_SERIALIZE(grey_peerlist_size)
|
KV_SERIALIZE(grey_peerlist_size)
|
||||||
KV_SERIALIZE(testnet)
|
KV_SERIALIZE(testnet)
|
||||||
KV_SERIALIZE(top_block_hash)
|
KV_SERIALIZE(top_block_hash)
|
||||||
|
KV_SERIALIZE(cumulative_difficulty)
|
||||||
END_KV_SERIALIZE_MAP()
|
END_KV_SERIALIZE_MAP()
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user