From 4bac60161029de6d71ef1e51e7af803ce6fb8405 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 33b57a528..35fbec666 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -4522,6 +4522,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 954cdd49d..de2955732 100644 --- a/src/net.h +++ b/src/net.h @@ -395,6 +395,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;