aboutsummaryrefslogtreecommitdiff
path: root/src/rpc
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2019-11-01 17:03:44 +0200
committerRiccardo Spagni <ric@spagni.net>2019-11-01 17:03:44 +0200
commitd4b5ba88df014275a9fda5e24ac097b80b2ca3f2 (patch)
tree58c76aca89188402efc5a32c35346d2a33d2a7c8 /src/rpc
parentMerge pull request #6062 (diff)
parentdaemon: always use bootstrap daemon (if set) in '--no-sync' mode (diff)
downloadmonero-d4b5ba88df014275a9fda5e24ac097b80b2ca3f2.tar.xz
Merge pull request #6064
0e3b823a1 daemon: always use bootstrap daemon (if set) in '--no-sync' mode (xiphon)
Diffstat (limited to 'src/rpc')
-rw-r--r--src/rpc/core_rpc_server.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp
index df264dde6..8c08b81b0 100644
--- a/src/rpc/core_rpc_server.cpp
+++ b/src/rpc/core_rpc_server.cpp
@@ -1903,7 +1903,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);
@@ -1927,9 +1928,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)
{