aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2020-10-13 10:53:20 -0500
committerluigi1111 <luigi1111w@gmail.com>2020-10-13 10:53:20 -0500
commit8ae0110d5472d721fc8858649ad6f05952b67abb (patch)
tree4606c77fb828588354a7c687d30f9df428f16e96
parentMerge pull request #6888 (diff)
parentcore_rpc_server: on_get_blocks - forward bootstrap daemon error (diff)
downloadmonero-8ae0110d5472d721fc8858649ad6f05952b67abb.tar.xz
Merge pull request #6893
4cf3545 core_rpc_server: on_get_blocks - forward bootstrap daemon error (xiphon)
-rw-r--r--src/rpc/core_rpc_server.cpp14
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);