diff --git a/src/main.cpp b/src/main.cpp index b5d4f3d94..e4504c0f6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -4937,6 +4937,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, if (pingUsecTime > 0) { // Successful ping time measurement, replace previous pfrom->nPingUsecTime = pingUsecTime; + pfrom->nMinPingUsecTime = std::min(pfrom->nMinPingUsecTime, pingUsecTime); } else { // This should never happen sProblem = "Timing mishap"; diff --git a/src/net.h b/src/net.h index 17502b97e..28f44646c 100644 --- a/src/net.h +++ b/src/net.h @@ -318,6 +318,8 @@ public: int64_t nPingUsecStart; // Last measured round-trip time. int64_t nPingUsecTime; + // Best measured round-trip time. + int64_t nMinPingUsecTime; // Whether a ping is requested. bool fPingQueued;