diff options
author | Riccardo Spagni <ric@spagni.net> | 2016-04-26 18:01:57 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2016-04-26 18:01:57 +0200 |
commit | 94a291f8fbf927cd1a9caa229e1aef0a5c07a9a2 (patch) | |
tree | afd15eed0ad6133c11860c87d35be2e9f7ccab98 /src/rpc/core_rpc_server.cpp | |
parent | Merge pull request #803 (diff) | |
parent | Add --restore-height option (diff) | |
download | monero-94a291f8fbf927cd1a9caa229e1aef0a5c07a9a2.tar.xz |
Merge pull request #806
19fe8ae Add --restore-height option (Howard Chu)
b6e42c3 Speed up new wallet refresh (Howard Chu)
b7140da Add GET_HASHES_FAST rpc, use it in wallet (Howard Chu)
Diffstat (limited to 'src/rpc/core_rpc_server.cpp')
-rw-r--r-- | src/rpc/core_rpc_server.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp index 9fcb4373b..9e8d1108e 100644 --- a/src/rpc/core_rpc_server.cpp +++ b/src/rpc/core_rpc_server.cpp @@ -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(); |