From 6de98697a1712f6a8e25f15a6b1740515bcd0c0b Mon Sep 17 00:00:00 2001 From: SChernykh Date: Tue, 24 Aug 2021 20:10:16 +0200 Subject: [PATCH] Only warn about lagging monerod if it's 2 or more blocks behind --- src/p2p_server.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/p2p_server.cpp b/src/p2p_server.cpp index af13c3b..6cca4af 100644 --- a/src/p2p_server.cpp +++ b/src/p2p_server.cpp @@ -1228,7 +1228,9 @@ bool P2PServer::P2PClient::on_block_broadcast(const uint8_t* buf, uint32_t size) } } else if (peer_height > our_height) { - LOGWARN(4, "peer " << static_cast(m_addrString) << " is ahead on mainchain (height " << peer_height << ", your height " << our_height << "). Is your monerod stuck or lagging?"); + if (peer_height >= our_height + 2) { + LOGWARN(4, "peer " << static_cast(m_addrString) << " is ahead on mainchain (height " << peer_height << ", your height " << our_height << "). Is your monerod stuck or lagging?"); + } return true; } else {