From e279e5f90aeaba08285a5c0c7a1b00cb3c2106b5 Mon Sep 17 00:00:00 2001 From: Patrick Strateman Date: Thu, 13 Aug 2015 02:31:46 -0700 Subject: [PATCH] Record nMinPingUsecTime --- src/main.cpp | 1 + src/net.h | 2 ++ 2 files changed, 3 insertions(+) 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;