Skip to content

Commit bbc2b39

Browse files
committed
Merge pull request #6633
a6eb4ba Report minimum ping time in getpeerinfo (Matt Corallo)
2 parents 9aa9099 + a6eb4ba commit bbc2b39

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

src/net.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,7 @@ void CNode::copyStats(CNodeStats &stats)
628628

629629
// Raw ping time is in microseconds, but show it to user as whole seconds (Bitcoin users should be well used to small numbers with many decimal places by now :)
630630
stats.dPingTime = (((double)nPingUsecTime) / 1e6);
631+
stats.dPingMin = (((double)nMinPingUsecTime) / 1e6);
631632
stats.dPingWait = (((double)nPingUsecWait) / 1e6);
632633

633634
// Leave string empty if addrLocal invalid (not filled in yet)

src/net.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ class CNodeStats
189189
bool fWhitelisted;
190190
double dPingTime;
191191
double dPingWait;
192+
double dPingMin;
192193
std::string addrLocal;
193194
};
194195

src/rpcnet.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ UniValue getpeerinfo(const UniValue& params, bool fHelp)
9696
" \"conntime\": ttt, (numeric) The connection time in seconds since epoch (Jan 1 1970 GMT)\n"
9797
" \"timeoffset\": ttt, (numeric) The time offset in seconds\n"
9898
" \"pingtime\": n, (numeric) ping time\n"
99+
" \"minping\": n, (numeric) minimum observed ping time\n"
99100
" \"pingwait\": n, (numeric) ping wait\n"
100101
" \"version\": v, (numeric) The peer version, such as 7001\n"
101102
" \"subver\": \"/Satoshi:0.8.5/\", (string) The string version\n"
@@ -139,6 +140,7 @@ UniValue getpeerinfo(const UniValue& params, bool fHelp)
139140
obj.push_back(Pair("conntime", stats.nTimeConnected));
140141
obj.push_back(Pair("timeoffset", stats.nTimeOffset));
141142
obj.push_back(Pair("pingtime", stats.dPingTime));
143+
obj.push_back(Pair("minping", stats.dPingMin));
142144
if (stats.dPingWait > 0.0)
143145
obj.push_back(Pair("pingwait", stats.dPingWait));
144146
obj.push_back(Pair("version", stats.nVersion));

0 commit comments

Comments
 (0)