Browse Source

Merge #7842: RPC: do not print minping time in getpeerinfo when no ping received yet

62a6486 RPC: do not print ping info in getpeerinfo when no ping received yet, fix help (Pavel Janík)
0.13
Wladimir J. van der Laan 9 years ago
parent
commit
d97101e5a8
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6
  1. 8
      src/rpc/net.cpp

8
src/rpc/net.cpp

@ -97,9 +97,9 @@ UniValue getpeerinfo(const UniValue& params, bool fHelp)
" \"bytesrecv\": n, (numeric) The total bytes received\n" " \"bytesrecv\": n, (numeric) The total bytes received\n"
" \"conntime\": ttt, (numeric) The connection time in seconds since epoch (Jan 1 1970 GMT)\n" " \"conntime\": ttt, (numeric) The connection time in seconds since epoch (Jan 1 1970 GMT)\n"
" \"timeoffset\": ttt, (numeric) The time offset in seconds\n" " \"timeoffset\": ttt, (numeric) The time offset in seconds\n"
" \"pingtime\": n, (numeric) ping time\n" " \"pingtime\": n, (numeric) ping time (if available)\n"
" \"minping\": n, (numeric) minimum observed ping time\n" " \"minping\": n, (numeric) minimum observed ping time (if any at all)\n"
" \"pingwait\": n, (numeric) ping wait\n" " \"pingwait\": n, (numeric) ping wait (if non-zero)\n"
" \"version\": v, (numeric) The peer version, such as 7001\n" " \"version\": v, (numeric) The peer version, such as 7001\n"
" \"subver\": \"/Satoshi:0.8.5/\", (string) The string version\n" " \"subver\": \"/Satoshi:0.8.5/\", (string) The string version\n"
" \"inbound\": true|false, (boolean) Inbound (true) or Outbound (false)\n" " \"inbound\": true|false, (boolean) Inbound (true) or Outbound (false)\n"
@ -150,7 +150,9 @@ UniValue getpeerinfo(const UniValue& params, bool fHelp)
obj.push_back(Pair("bytesrecv", stats.nRecvBytes)); obj.push_back(Pair("bytesrecv", stats.nRecvBytes));
obj.push_back(Pair("conntime", stats.nTimeConnected)); obj.push_back(Pair("conntime", stats.nTimeConnected));
obj.push_back(Pair("timeoffset", stats.nTimeOffset)); obj.push_back(Pair("timeoffset", stats.nTimeOffset));
if (stats.dPingTime > 0.0)
obj.push_back(Pair("pingtime", stats.dPingTime)); obj.push_back(Pair("pingtime", stats.dPingTime));
if (stats.dPingMin < std::numeric_limits<int64_t>::max()/1e6)
obj.push_back(Pair("minping", stats.dPingMin)); obj.push_back(Pair("minping", stats.dPingMin));
if (stats.dPingWait > 0.0) if (stats.dPingWait > 0.0)
obj.push_back(Pair("pingwait", stats.dPingWait)); obj.push_back(Pair("pingwait", stats.dPingWait));

Loading…
Cancel
Save