diff options
author | xiphon <xiphon@protonmail.com> | 2019-10-28 21:52:19 +0000 |
---|---|---|
committer | xiphon <xiphon@protonmail.com> | 2019-10-30 19:45:23 +0000 |
commit | 0e3b823a15793f4ccb815d0ad183f39e14930955 (patch) | |
tree | 5fa89814f97873efc1b4f0322595c94af0eee4a1 /src/rpc/core_rpc_server.cpp | |
parent | Merge pull request #6002 (diff) | |
download | monero-0e3b823a15793f4ccb815d0ad183f39e14930955.tar.xz |
daemon: always use bootstrap daemon (if set) in '--no-sync' mode
Diffstat (limited to 'src/rpc/core_rpc_server.cpp')
-rw-r--r-- | src/rpc/core_rpc_server.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp index dfc4d4cf3..eb71504f0 100644 --- a/src/rpc/core_rpc_server.cpp +++ b/src/rpc/core_rpc_server.cpp @@ -1666,7 +1666,8 @@ namespace cryptonote } auto current_time = std::chrono::system_clock::now(); - if (current_time - m_bootstrap_height_check_time > std::chrono::seconds(30)) // update every 30s + if (!m_p2p.get_payload_object().no_sync() && + current_time - m_bootstrap_height_check_time > std::chrono::seconds(30)) // update every 30s { { boost::upgrade_to_unique_lock<boost::shared_mutex> lock(upgrade_lock); @@ -1690,9 +1691,10 @@ namespace cryptonote uint64_t top_height = m_core.get_current_blockchain_height(); m_should_use_bootstrap_daemon = top_height + 10 < *bootstrap_daemon_height; MINFO((m_should_use_bootstrap_daemon ? "Using" : "Not using") << " the bootstrap daemon (our height: " << top_height << ", bootstrap daemon's height: " << *bootstrap_daemon_height << ")"); + + if (!m_should_use_bootstrap_daemon) + return false; } - if (!m_should_use_bootstrap_daemon) - return false; if (mode == invoke_http_mode::JON) { |