diff --git a/src/ripple/overlay/impl/PeerImp.cpp b/src/ripple/overlay/impl/PeerImp.cpp index 497a13bed9..6cc05ad172 100644 --- a/src/ripple/overlay/impl/PeerImp.cpp +++ b/src/ripple/overlay/impl/PeerImp.cpp @@ -537,6 +537,17 @@ PeerImp::onTimer (error_code const& ec) send (std::make_shared ( message, protocol::mtPING)); } + else + { + // We have an outstanding ping, raise latency + auto minLatency = std::chrono::duration_cast + (clock_type::now() - lastPingTime_); + + std::lock_guard sl(recentLock_); + + if (latency_ < minLatency) + latency_ = minLatency; + } setTimer(); } diff --git a/src/ripple/overlay/impl/Tuning.h b/src/ripple/overlay/impl/Tuning.h index 2fdd20e41d..58c88f7eb6 100644 --- a/src/ripple/overlay/impl/Tuning.h +++ b/src/ripple/overlay/impl/Tuning.h @@ -54,16 +54,16 @@ enum checkSeconds = 10, /** How often we latency/sendq probe connections */ - timerSeconds = 3, + timerSeconds = 4, /** How many timer intervals a sendq has to stay large before we disconnect */ - sendqIntervals = 3, + sendqIntervals = 4, /** How many timer intervals we can go without a ping reply */ - noPing = 4, + noPing = 10, /** How many messages on a send queue before we refuse queries */ - dropSendQueue = 5, + dropSendQueue = 8, /** How many messages we consider reasonable sustained on a send queue */ targetSendQueue = 16,