File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -165,12 +165,15 @@ static UniValue getpeerinfo(const JSONRPCRequest& request)
165
165
obj.pushKV (" bytesrecv" , stats.nRecvBytes );
166
166
obj.pushKV (" conntime" , stats.nTimeConnected );
167
167
obj.pushKV (" timeoffset" , stats.nTimeOffset );
168
- if (stats.m_ping_usec > 0 )
169
- obj.pushKV (" pingtime" , stats.m_ping_usec / 1e6 );
170
- if (stats.m_min_ping_usec < std::numeric_limits<int64_t >::max ())
171
- obj.pushKV (" minping" , stats.m_min_ping_usec / 1e6 );
172
- if (stats.m_ping_wait_usec > 0 )
173
- obj.pushKV (" pingwait" , stats.m_ping_wait_usec / 1e6 );
168
+ if (stats.m_ping_usec > 0 ) {
169
+ obj.pushKV (" pingtime" , ((double )stats.m_ping_usec ) / 1e6 );
170
+ }
171
+ if (stats.m_min_ping_usec < std::numeric_limits<int64_t >::max ()) {
172
+ obj.pushKV (" minping" , ((double )stats.m_min_ping_usec ) / 1e6 );
173
+ }
174
+ if (stats.m_ping_wait_usec > 0 ) {
175
+ obj.pushKV (" pingwait" , ((double )stats.m_ping_wait_usec ) / 1e6 );
176
+ }
174
177
obj.pushKV (" version" , stats.nVersion );
175
178
// Use the sanitized form of subver here, to avoid tricksy remote peers from
176
179
// corrupting or modifying the JSON output by putting special characters in
You can’t perform that action at this time.
0 commit comments