mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-11-10 13:13:27 +01:00
Merge pull request #5376
c746f45d
Add hash of top block to /getheight RPC (Howard Chu)
This commit is contained in:
commit
4a2cc76c84
@ -202,7 +202,9 @@ namespace cryptonote
|
|||||||
if (use_bootstrap_daemon_if_necessary<COMMAND_RPC_GET_HEIGHT>(invoke_http_mode::JON, "/getheight", req, res, r))
|
if (use_bootstrap_daemon_if_necessary<COMMAND_RPC_GET_HEIGHT>(invoke_http_mode::JON, "/getheight", req, res, r))
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
res.height = m_core.get_current_blockchain_height();
|
crypto::hash hash;
|
||||||
|
m_core.get_blockchain_top(res.height, hash);
|
||||||
|
res.hash = string_tools::pod_to_hex(hash);
|
||||||
res.status = CORE_RPC_STATUS_OK;
|
res.status = CORE_RPC_STATUS_OK;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -102,11 +102,13 @@ namespace cryptonote
|
|||||||
uint64_t height;
|
uint64_t height;
|
||||||
std::string status;
|
std::string status;
|
||||||
bool untrusted;
|
bool untrusted;
|
||||||
|
std::string hash;
|
||||||
|
|
||||||
BEGIN_KV_SERIALIZE_MAP()
|
BEGIN_KV_SERIALIZE_MAP()
|
||||||
KV_SERIALIZE(height)
|
KV_SERIALIZE(height)
|
||||||
KV_SERIALIZE(status)
|
KV_SERIALIZE(status)
|
||||||
KV_SERIALIZE(untrusted)
|
KV_SERIALIZE(untrusted)
|
||||||
|
KV_SERIALIZE(hash)
|
||||||
END_KV_SERIALIZE_MAP()
|
END_KV_SERIALIZE_MAP()
|
||||||
};
|
};
|
||||||
typedef epee::misc_utils::struct_init<response_t> response;
|
typedef epee::misc_utils::struct_init<response_t> response;
|
||||||
|
Loading…
Reference in New Issue
Block a user