diff options
Diffstat (limited to 'src/rpc')
-rw-r--r-- | src/rpc/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/rpc/core_rpc_server.cpp | 23 |
2 files changed, 20 insertions, 5 deletions
diff --git a/src/rpc/CMakeLists.txt b/src/rpc/CMakeLists.txt index 19298c969..aa4102481 100644 --- a/src/rpc/CMakeLists.txt +++ b/src/rpc/CMakeLists.txt @@ -66,7 +66,7 @@ set(rpc_pub_headers zmq_pub.h) set(daemon_rpc_server_headers) -set(rpc_daemon_private_headers +set(rpc_private_headers bootstrap_daemon.h core_rpc_server.h rpc_payment.h diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp index a50c70418..e72f60d05 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); @@ -1129,7 +1137,7 @@ namespace cryptonote if (!restricted) { boost::shared_lock<boost::shared_mutex> lock(m_bootstrap_daemon_mutex); - if (m_bootstrap_daemon.get() != nullptr) + if (m_should_use_bootstrap_daemon) { skip_validation = !check_core_ready(); } @@ -1661,6 +1669,13 @@ namespace cryptonote return false; } + uint64_t next_height; + crypto::rx_seedheights(height, &seed_height, &next_height); + if (next_height != seed_height) + next_seed_hash = m_core.get_block_id_by_height(next_height); + else + next_seed_hash = seed_hash; + if (extra_nonce.empty()) { reserved_offset = 0; |