aboutsummaryrefslogtreecommitdiff
path: root/src/qt
diff options
context:
space:
mode:
authorBen Woosley <ben.woosley@gmail.com>2020-03-03 08:42:50 -0500
committerBen Woosley <ben.woosley@gmail.com>2020-03-04 13:45:29 -0500
commit7a810b1d7a9d03818706dc94457dc3255f062796 (patch)
tree6879f95472c704bc48e85beaca23b91b330f1c46 /src/qt
parente6fc63ec7ee637a4b533e4d7b22def05e74e1dff (diff)
refactor: Convert ping wait time from double to int64_t
Diffstat (limited to 'src/qt')
-rw-r--r--src/qt/guiutil.cpp5
-rw-r--r--src/qt/guiutil.h3
-rw-r--r--src/qt/rpcconsole.cpp2
3 files changed, 1 insertions, 9 deletions
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)));