mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-12-23 21:57:46 +00:00
daemon: always use bootstrap daemon (if set) in '--no-sync' mode
This commit is contained in:
parent
cc46f05f1f
commit
0e3b823a15
2 changed files with 6 additions and 3 deletions
|
@ -112,6 +112,7 @@ namespace cryptonote
|
||||||
void stop();
|
void stop();
|
||||||
void on_connection_close(cryptonote_connection_context &context);
|
void on_connection_close(cryptonote_connection_context &context);
|
||||||
void set_max_out_peers(unsigned int max) { m_max_out_peers = max; }
|
void set_max_out_peers(unsigned int max) { m_max_out_peers = max; }
|
||||||
|
bool no_sync() const { return m_no_sync; }
|
||||||
void set_no_sync(bool value) { m_no_sync = value; }
|
void set_no_sync(bool value) { m_no_sync = value; }
|
||||||
std::string get_peers_overview() const;
|
std::string get_peers_overview() const;
|
||||||
std::pair<uint32_t, uint32_t> get_next_needed_pruning_stripe() const;
|
std::pair<uint32_t, uint32_t> get_next_needed_pruning_stripe() const;
|
||||||
|
|
|
@ -1666,7 +1666,8 @@ namespace cryptonote
|
||||||
}
|
}
|
||||||
|
|
||||||
auto current_time = std::chrono::system_clock::now();
|
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);
|
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();
|
uint64_t top_height = m_core.get_current_blockchain_height();
|
||||||
m_should_use_bootstrap_daemon = top_height + 10 < *bootstrap_daemon_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 << ")");
|
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)
|
if (!m_should_use_bootstrap_daemon)
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (mode == invoke_http_mode::JON)
|
if (mode == invoke_http_mode::JON)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue