From d8f3b81f798afcc11fc44f9e5f09e137012f5c3a Mon Sep 17 00:00:00 2001 From: selsta Date: Thu, 14 May 2026 17:34:37 +0200 Subject: [PATCH] p2p: restore safe sync mode when target height drops --- src/cryptonote_protocol/cryptonote_protocol_handler.inl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/cryptonote_protocol/cryptonote_protocol_handler.inl b/src/cryptonote_protocol/cryptonote_protocol_handler.inl index a115d50ad..071625c1b 100644 --- a/src/cryptonote_protocol/cryptonote_protocol_handler.inl +++ b/src/cryptonote_protocol/cryptonote_protocol_handler.inl @@ -2873,6 +2873,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");