p2p: restore safe sync mode when target height drops

(cherry picked from commit 12098ff5d66d86d73360d28c548c350f6e7b64c8)
This commit is contained in:
selsta
2026-10-04 18:50:21 -04:00
committed by such-gitea
parent bcdb7c1075
commit ed8fc0a8fd
@@ -2860,6 +2860,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", "wownerod is now disconnected from the network");