core_rpc_server: on_get_blocks - forward bootstrap daemon error

This commit is contained in:
xiphon 2020-10-12 23:44:10 +00:00 committed by wowario
parent 51169a6c2d
commit 2051c5f078
No known key found for this signature in database
GPG Key ID: 24DCBE762DE9C111
1 changed files with 11 additions and 3 deletions

View File

@ -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) 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); 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)) bool use_bootstrap_daemon;
return r; {
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); CHECK_PAYMENT(req, res, 1);