diff options
author | xiphon <xiphon@protonmail.com> | 2020-10-12 23:44:10 +0000 |
---|---|---|
committer | xiphon <xiphon@protonmail.com> | 2020-10-13 00:44:59 +0000 |
commit | 4cf3545a31f1f65ed887ece2fe969d6cca495389 (patch) | |
tree | 9e7857ac5ae41a26e7873a119580e5b0a900c42c /src/rpc/core_rpc_server.cpp | |
parent | Merge pull request #6819 (diff) | |
download | monero-4cf3545a31f1f65ed887ece2fe969d6cca495389.tar.xz |
core_rpc_server: on_get_blocks - forward bootstrap daemon error
Diffstat (limited to '')
-rw-r--r-- | src/rpc/core_rpc_server.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp index a50c70418..382b5815f 100644 --- a/src/rpc/core_rpc_server.cpp +++ b/src/rpc/core_rpc_server.cpp @@ -521,9 +521,17 @@ namespace cryptonote bool core_rpc_server::on_get_blocks(const COMMAND_RPC_GET_BLOCKS_FAST::request& req, COMMAND_RPC_GET_BLOCKS_FAST::response& res, const connection_context *ctx) { RPC_TRACKER(get_blocks); - bool r; - if (use_bootstrap_daemon_if_necessary<COMMAND_RPC_GET_BLOCKS_FAST>(invoke_http_mode::BIN, "/getblocks.bin", req, res, r)) - return r; + + bool use_bootstrap_daemon; + { + boost::shared_lock<boost::shared_mutex> lock(m_bootstrap_daemon_mutex); + use_bootstrap_daemon = m_should_use_bootstrap_daemon; + } + if (use_bootstrap_daemon) + { + bool r; + return use_bootstrap_daemon_if_necessary<COMMAND_RPC_GET_BLOCKS_FAST>(invoke_http_mode::BIN, "/getblocks.bin", req, res, r); + } CHECK_PAYMENT(req, res, 1); |