diff options
author | Alexander Blair <snipa@jagtech.io> | 2020-10-18 23:26:17 -0700 |
---|---|---|
committer | Alexander Blair <snipa@jagtech.io> | 2020-10-18 23:26:17 -0700 |
commit | faedcded39518eee5fefd7c45a87ebbcc15c99b4 (patch) | |
tree | d7f71e6e396e0cbd24cacf383f3443710935d570 /src | |
parent | Merge pull request #6881 (diff) | |
parent | core_rpc_server: on_get_blocks - forward bootstrap daemon error (diff) | |
download | monero-faedcded39518eee5fefd7c45a87ebbcc15c99b4.tar.xz |
Merge pull request #6891
4cf3545a3 core_rpc_server: on_get_blocks - forward bootstrap daemon error (xiphon)
Diffstat (limited to 'src')
-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); |