mirror of
https://github.com/monero-project/monero.git
synced 2026-01-01 07:26:15 -08:00
Add GET_HASHES_FAST rpc, use it in wallet
When m_refresh_from_block_height has been set, only hashes will be retrieved up to that height, instead of full blocks. The same will be done for "refresh <height>" when the specified height is beyond the current local blockchain.
This commit is contained in:
@@ -166,6 +166,25 @@ namespace cryptonote
|
||||
return true;
|
||||
}
|
||||
//------------------------------------------------------------------------------------------------------------------------------
|
||||
bool core_rpc_server::on_get_hashes(const COMMAND_RPC_GET_HASHES_FAST::request& req, COMMAND_RPC_GET_HASHES_FAST::response& res)
|
||||
{
|
||||
CHECK_CORE_BUSY();
|
||||
NOTIFY_RESPONSE_CHAIN_ENTRY::request resp;
|
||||
|
||||
resp.start_height = req.start_height;
|
||||
if(!m_core.find_blockchain_supplement(req.block_ids, resp))
|
||||
{
|
||||
res.status = "Failed";
|
||||
return false;
|
||||
}
|
||||
res.current_height = resp.total_height;
|
||||
res.start_height = resp.start_height;
|
||||
res.m_block_ids = std::move(resp.m_block_ids);
|
||||
|
||||
res.status = CORE_RPC_STATUS_OK;
|
||||
return true;
|
||||
}
|
||||
//------------------------------------------------------------------------------------------------------------------------------
|
||||
bool core_rpc_server::on_get_random_outs(const COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS::request& req, COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS::response& res)
|
||||
{
|
||||
CHECK_CORE_BUSY();
|
||||
|
||||
Reference in New Issue
Block a user