aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorselsta <selsta@sent.at>2026-05-14 17:34:37 +0200
committerselsta <selsta@sent.at>2026-06-24 22:04:34 +0200
commit12098ff5d66d86d73360d28c548c350f6e7b64c8 (patch)
tree71e9ea70cc87705bdcab893e0d6d45b6d8070660
parent71d2d3728ea3454c02e7de851abda54b87915a6a (diff)
downloadmonzero-core-12098ff5d66d86d73360d28c548c350f6e7b64c8.tar.gz
monzero-core-12098ff5d66d86d73360d28c548c350f6e7b64c8.tar.xz
monzero-core-12098ff5d66d86d73360d28c548c350f6e7b64c8.zip
p2p: restore safe sync mode when target height drops
-rw-r--r--src/cryptonote_protocol/cryptonote_protocol_handler.inl2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/cryptonote_protocol/cryptonote_protocol_handler.inl b/src/cryptonote_protocol/cryptonote_protocol_handler.inl
index 6c36a3b5b..cf6830f64 100644
--- a/src/cryptonote_protocol/cryptonote_protocol_handler.inl
+++ b/src/cryptonote_protocol/cryptonote_protocol_handler.inl
@@ -2841,6 +2841,8 @@ skip:
{
MINFO("Target height decreasing from " << previous_target << " to " << target);
m_core.set_target_blockchain_height(target);
+ if (target < m_core.get_current_blockchain_height() + 5)
+ m_core.safesyncmode(true);
if (target == 0 && context.m_state > cryptonote_connection_context::state_before_handshake && !m_stopping)
{
MCWARNING("global", "monerod is now disconnected from the network");