mirror of
https://github.com/monero-project/monero.git
synced 2024-11-18 10:01:02 +00:00
rpc: add missing top block hash to json getinfo call
This commit is contained in:
parent
34fcfcd7cc
commit
094f4c8cc6
1 changed files with 8 additions and 1 deletions
|
@ -1092,7 +1092,14 @@ namespace cryptonote
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
res.height = m_core.get_current_blockchain_height();
|
crypto::hash top_hash;
|
||||||
|
if (!m_core.get_blockchain_top(res.height, top_hash))
|
||||||
|
{
|
||||||
|
res.status = "Failed";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
++res.height; // turn top block height into blockchain height
|
||||||
|
res.top_block_hash = string_tools::pod_to_hex(top_hash);
|
||||||
res.target_height = m_core.get_target_blockchain_height();
|
res.target_height = m_core.get_target_blockchain_height();
|
||||||
res.difficulty = m_core.get_blockchain_storage().get_difficulty_for_next_block();
|
res.difficulty = m_core.get_blockchain_storage().get_difficulty_for_next_block();
|
||||||
res.target = m_core.get_blockchain_storage().get_current_hard_fork_version() < 2 ? DIFFICULTY_TARGET_V1 : DIFFICULTY_TARGET_V2;
|
res.target = m_core.get_blockchain_storage().get_current_hard_fork_version() < 2 ? DIFFICULTY_TARGET_V1 : DIFFICULTY_TARGET_V2;
|
||||||
|
|
Loading…
Reference in a new issue