aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/net.cpp2
-rw-r--r--src/net.h2
-rw-r--r--src/qt/guiutil.cpp5
-rw-r--r--src/qt/guiutil.h3
-rw-r--r--src/qt/rpcconsole.cpp2
-rw-r--r--src/rpc/net.cpp4
6 files changed, 5 insertions, 13 deletions
diff --git a/src/net.cpp b/src/net.cpp
index 8177ca3e3b..d156450394 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -557,7 +557,7 @@ void CNode::copyStats(CNodeStats &stats, const std::vector<bool> &m_asmap)
// 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 :)
stats.m_ping_usec = nPingUsecTime;
stats.m_min_ping_usec = nMinPingUsecTime;
- stats.dPingWait = (((double)nPingUsecWait) / 1e6);
+ stats.m_ping_wait_usec = nPingUsecWait;
// Leave string empty if addrLocal invalid (not filled in yet)
CService addrLocalUnlocked = GetAddrLocal();
diff --git a/src/net.h b/src/net.h
index 7cb7c485fa..975d7f15d7 100644
--- a/src/net.h
+++ b/src/net.h
@@ -597,7 +597,7 @@ public:
NetPermissionFlags m_permissionFlags;
bool m_legacyWhitelisted;
int64_t m_ping_usec;
- double dPingWait;
+ int64_t m_ping_wait_usec;
int64_t m_min_ping_usec;
CAmount minFeeFilter;
// Our address, as reported by the peer
diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp
index 88dc87a7fc..98dde1656a 100644
--- a/src/qt/guiutil.cpp
+++ b/src/qt/guiutil.cpp
@@ -773,11 +773,6 @@ QString formatServicesStr(quint64 mask)
return QObject::tr("None");
}
-QString formatPingTime(double dPingTime)
-{
- return (dPingTime == std::numeric_limits<int64_t>::max()/1e6 || dPingTime == 0) ? QObject::tr("N/A") : QString(QObject::tr("%1 ms")).arg(QString::number((int)(dPingTime * 1000), 10));
-}
-
QString formatPingTime(int64_t ping_usec)
{
return (ping_usec == std::numeric_limits<int64_t>::max() || ping_usec == 0) ? QObject::tr("N/A") : QString(QObject::tr("%1 ms")).arg(QString::number((int)(ping_usec / 1000), 10));
diff --git a/src/qt/guiutil.h b/src/qt/guiutil.h
index 913d38c48a..e571262443 100644
--- a/src/qt/guiutil.h
+++ b/src/qt/guiutil.h
@@ -202,9 +202,6 @@ namespace GUIUtil
/* Format CNodeStats.nServices bitmask into a user-readable string */
QString formatServicesStr(quint64 mask);
- /* Format a CNodeCombinedStats.dPingTime into a user-readable string or display N/A, if 0*/
- QString formatPingTime(double dPingTime);
-
/* Format a CNodeStats.m_ping_usec into a user-readable string or display N/A, if 0*/
QString formatPingTime(int64_t ping_usec);
diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp
index 896675a493..b82ab9ffe8 100644
--- a/src/qt/rpcconsole.cpp
+++ b/src/qt/rpcconsole.cpp
@@ -1110,7 +1110,7 @@ void RPCConsole::updateNodeDetail(const CNodeCombinedStats *stats)
ui->peerBytesRecv->setText(GUIUtil::formatBytes(stats->nodeStats.nRecvBytes));
ui->peerConnTime->setText(GUIUtil::formatDurationStr(GetSystemTimeInSeconds() - stats->nodeStats.nTimeConnected));
ui->peerPingTime->setText(GUIUtil::formatPingTime(stats->nodeStats.m_ping_usec));
- ui->peerPingWait->setText(GUIUtil::formatPingTime(stats->nodeStats.dPingWait));
+ ui->peerPingWait->setText(GUIUtil::formatPingTime(stats->nodeStats.m_ping_wait_usec));
ui->peerMinPing->setText(GUIUtil::formatPingTime(stats->nodeStats.m_min_ping_usec));
ui->timeoffset->setText(GUIUtil::formatTimeOffset(stats->nodeStats.nTimeOffset));
ui->peerVersion->setText(QString("%1").arg(QString::number(stats->nodeStats.nVersion)));
diff --git a/src/rpc/net.cpp b/src/rpc/net.cpp
index c1b350526d..e8ae458c57 100644
--- a/src/rpc/net.cpp
+++ b/src/rpc/net.cpp
@@ -169,8 +169,8 @@ static UniValue getpeerinfo(const JSONRPCRequest& request)
obj.pushKV("pingtime", stats.m_ping_usec / 1e6);
if (stats.m_min_ping_usec < std::numeric_limits<int64_t>::max())
obj.pushKV("minping", stats.m_min_ping_usec / 1e6);
- if (stats.dPingWait > 0.0)
- obj.pushKV("pingwait", stats.dPingWait);
+ if (stats.m_ping_wait_usec > 0)
+ obj.pushKV("pingwait", stats.m_ping_wait_usec / 1e6);
obj.pushKV("version", stats.nVersion);
// Use the sanitized form of subver here, to avoid tricksy remote peers from
// corrupting or modifying the JSON output by putting special characters in