diff --git a/src/qt/forms/debugwindow.ui b/src/qt/forms/debugwindow.ui index 753c9ba485..7faa1d25d3 100644 --- a/src/qt/forms/debugwindow.ui +++ b/src/qt/forms/debugwindow.ui @@ -1239,14 +1239,17 @@ - + + + Elapsed time since a novel block passing initial validity checks was received from this peer. + - Last Send + Last Block - + IBeamCursor @@ -1262,14 +1265,17 @@ - + + + Elapsed time since a novel transaction accepted into our mempool was received from this peer. + - Last Receive + Last Tx - + IBeamCursor @@ -1285,14 +1291,14 @@ - + - Sent + Last Send - + IBeamCursor @@ -1308,14 +1314,14 @@ - + - Received + Last Receive - + IBeamCursor @@ -1331,14 +1337,14 @@ - + - Ping Time + Sent - + IBeamCursor @@ -1354,17 +1360,14 @@ - - - The duration of a currently outstanding ping. - + - Ping Wait + Received - + IBeamCursor @@ -1380,14 +1383,14 @@ - + - Min Ping + Ping Time - + IBeamCursor @@ -1403,14 +1406,17 @@ - + + + The duration of a currently outstanding ping. + - Time Offset + Ping Wait - + IBeamCursor @@ -1426,17 +1432,14 @@ - - - The mapped Autonomous System used for diversifying peer selection. - + - Mapped AS + Min Ping - + IBeamCursor @@ -1452,6 +1455,55 @@ + + + Time Offset + + + + + + + IBeamCursor + + + N/A + + + Qt::PlainText + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + + + The mapped Autonomous System used for diversifying peer selection. + + + Mapped AS + + + + + + + IBeamCursor + + + N/A + + + Qt::PlainText + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + Qt::Vertical diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index d852c9291a..c1953e1273 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -1244,11 +1244,14 @@ void RPCConsole::updateNodeDetail(const CNodeCombinedStats *stats) ui->peerHeading->setText(peerAddrDetails); ui->peerServices->setText(GUIUtil::formatServicesStr(stats->nodeStats.nServices)); ui->peerRelayTxes->setText(stats->nodeStats.fRelayTxes ? "Yes" : "No"); - ui->peerLastSend->setText(stats->nodeStats.nLastSend ? GUIUtil::formatDurationStr(GetSystemTimeInSeconds() - stats->nodeStats.nLastSend) : tr("never")); - ui->peerLastRecv->setText(stats->nodeStats.nLastRecv ? GUIUtil::formatDurationStr(GetSystemTimeInSeconds() - stats->nodeStats.nLastRecv) : tr("never")); + const int64_t time_now{GetSystemTimeInSeconds()}; + ui->peerConnTime->setText(GUIUtil::formatDurationStr(time_now - stats->nodeStats.nTimeConnected)); + ui->peerLastBlock->setText(TimeDurationField(time_now, stats->nodeStats.nLastBlockTime)); + ui->peerLastTx->setText(TimeDurationField(time_now, stats->nodeStats.nLastTXTime)); + ui->peerLastSend->setText(TimeDurationField(time_now, stats->nodeStats.nLastSend)); + ui->peerLastRecv->setText(TimeDurationField(time_now, stats->nodeStats.nLastRecv)); ui->peerBytesSent->setText(GUIUtil::formatBytes(stats->nodeStats.nSendBytes)); 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->peerMinPing->setText(GUIUtil::formatPingTime(stats->nodeStats.m_min_ping_usec)); ui->timeoffset->setText(GUIUtil::formatTimeOffset(stats->nodeStats.nTimeOffset)); diff --git a/src/qt/rpcconsole.h b/src/qt/rpcconsole.h index febc46c9b1..79af6df9a3 100644 --- a/src/qt/rpcconsole.h +++ b/src/qt/rpcconsole.h @@ -194,6 +194,11 @@ private: /** Update UI with latest network info from model. */ void updateNetworkState(); + /** Helper for the output of a time duration field. Inputs are UNIX epoch times. */ + QString TimeDurationField(uint64_t time_now, uint64_t time_at_event) const { + return time_at_event ? GUIUtil::formatDurationStr(time_now - time_at_event) : tr("Never"); + } + private Q_SLOTS: void updateAlerts(const QString& warnings); };