From db0982048a53472111d36fd0ae0d4f0e256d41ae Mon Sep 17 00:00:00 2001 From: Valentin Balaschenko <13349202+vlntb@users.noreply.github.com> Date: Thu, 17 Apr 2025 11:20:28 +0100 Subject: [PATCH] increase max ping --- src/xrpld/overlay/detail/PeerImp.cpp | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/xrpld/overlay/detail/PeerImp.cpp b/src/xrpld/overlay/detail/PeerImp.cpp index 2372987601..eb1840bace 100644 --- a/src/xrpld/overlay/detail/PeerImp.cpp +++ b/src/xrpld/overlay/detail/PeerImp.cpp @@ -733,21 +733,28 @@ PeerImp::onTimer(error_code const& ec) } // Already waiting for PONG - if (lastPingSeq_ && (pingAttempts_ < maxPingNumber)) + if (lastPingSeq_) { pingAttempts_++; - JLOG(journal_.info()) << "Missing PONG, sending PING, attempt " - << pingAttempts_ << " of " << maxPingNumber; + + if (pingAttempts_ >= maxPingNumber) + { + fail("Ping Timeout"); + return; + } + else + { + JLOG(journal_.info()) << "Missing PONG, sending PING, attempt " + << pingAttempts_ << " of " << maxPingNumber; + } } - else if (lastPingSeq_) + else { - fail("Ping Timeout"); - return; + pingAttempts_ = 0; } lastPingTime_ = clock_type::now(); lastPingSeq_ = rand_int(); - pingAttempts_ = 0; protocol::TMPing message; message.set_type(protocol::TMPing::ptPING);