diff options
author | MarcoFalke <falke.marco@gmail.com> | 2020-07-10 18:19:11 +0200 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2021-12-06 10:47:52 +0100 |
commit | fadc0c80ae4e526fb2b503f7cc02f6122aaf1de5 (patch) | |
tree | fcae45e90b07fc8721022b9ef8b7e09cead39406 /src/qt/rpcconsole.cpp | |
parent | fa6d5a238d2c94440105ddd4f1554f85659d6c5b (diff) |
p2p: Make timeout mockable and type safe, speed up test
Diffstat (limited to 'src/qt/rpcconsole.cpp')
-rw-r--r-- | src/qt/rpcconsole.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index 5b95c92392..3267d20bee 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -1137,7 +1137,7 @@ void RPCConsole::on_sldGraphRange_valueChanged(int value) void RPCConsole::setTrafficGraphRange(int mins) { ui->trafficGraph->setGraphRangeMins(mins); - ui->lblGraphRange->setText(GUIUtil::formatDurationStr(mins * 60)); + ui->lblGraphRange->setText(GUIUtil::formatDurationStr(std::chrono::minutes{mins})); } void RPCConsole::updateTrafficStats(quint64 totalBytesIn, quint64 totalBytesOut) @@ -1168,10 +1168,10 @@ void RPCConsole::updateDetailWidget() if (stats->nodeStats.m_bip152_highbandwidth_from) bip152_hb_settings += (bip152_hb_settings.isEmpty() ? ts.from : QLatin1Char('/') + ts.from); if (bip152_hb_settings.isEmpty()) bip152_hb_settings = ts.no; ui->peerHighBandwidth->setText(bip152_hb_settings); - const int64_t time_now{GetTimeSeconds()}; - 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)); + const auto time_now{GetTime<std::chrono::seconds>()}; + ui->peerConnTime->setText(GUIUtil::formatDurationStr(time_now - std::chrono::seconds{stats->nodeStats.nTimeConnected})); + ui->peerLastBlock->setText(TimeDurationField(time_now, std::chrono::seconds{stats->nodeStats.nLastBlockTime})); + ui->peerLastTx->setText(TimeDurationField(time_now, std::chrono::seconds{stats->nodeStats.nLastTXTime})); ui->peerLastSend->setText(TimeDurationField(time_now, stats->nodeStats.m_last_send)); ui->peerLastRecv->setText(TimeDurationField(time_now, stats->nodeStats.m_last_recv)); ui->peerBytesSent->setText(GUIUtil::formatBytes(stats->nodeStats.nSendBytes)); |