From 142807af8b82e2372a03df893c50df4f4a96aca4 Mon Sep 17 00:00:00 2001 From: Jon Atack Date: Sat, 30 Jan 2021 23:54:12 +0100 Subject: [PATCH] gui: display BIP152 high bandwidth relay in peer details --- src/qt/forms/debugwindow.ui | 116 ++++++++++++++++++++++-------------- src/qt/rpcconsole.cpp | 10 ++++ 2 files changed, 81 insertions(+), 45 deletions(-) diff --git a/src/qt/forms/debugwindow.ui b/src/qt/forms/debugwindow.ui index 769da4b45bb..e4838b60f49 100644 --- a/src/qt/forms/debugwindow.ui +++ b/src/qt/forms/debugwindow.ui @@ -1224,14 +1224,17 @@ - + + + High bandwidth BIP152 compact block relay: %1 + - Starting Block + High Bandwidth - + IBeamCursor @@ -1247,14 +1250,14 @@ - + - Synced Headers + Starting Block - + IBeamCursor @@ -1270,14 +1273,14 @@ - + - Synced Blocks + Synced Headers - + IBeamCursor @@ -1293,14 +1296,14 @@ - + - Connection Time + Synced Blocks - + IBeamCursor @@ -1316,14 +1319,14 @@ - + - Last Send + Connection Time - + IBeamCursor @@ -1339,14 +1342,14 @@ - + - Last Receive + Last Send - + IBeamCursor @@ -1362,14 +1365,14 @@ - + - Sent + Last Receive - + IBeamCursor @@ -1385,14 +1388,14 @@ - + - Received + Sent - + IBeamCursor @@ -1408,14 +1411,14 @@ - + - Ping Time + Received - + IBeamCursor @@ -1431,17 +1434,14 @@ - - - The duration of a currently outstanding ping. - + - Ping Wait + Ping Time - + IBeamCursor @@ -1457,14 +1457,17 @@ - + + + The duration of a currently outstanding ping. + - Min Ping + Ping Wait - + IBeamCursor @@ -1480,14 +1483,14 @@ - + - Time Offset + Min Ping - + IBeamCursor @@ -1503,17 +1506,14 @@ - - - The mapped Autonomous System used for diversifying peer selection. - + - Mapped AS + Time Offset - + IBeamCursor @@ -1529,6 +1529,32 @@ + + + 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 52ebfb16b75..76ed9ca6b99 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -473,6 +473,11 @@ RPCConsole::RPCConsole(interfaces::Node& node, const PlatformStyle *_platformSty tr("Outbound Address Fetch: short-lived, for soliciting addresses")}; const QString list{"
  • " + Join(CONNECTION_TYPE_DOC, QString("
  • ")) + "
"}; ui->peerConnectionTypeLabel->setToolTip(ui->peerConnectionTypeLabel->toolTip().arg(list)); + const QString hb_list{"
  • \"" + + tr("To") + "\" – " + tr("we selected the peer for high bandwidth relay") + "
  • \"" + + tr("From") + "\" – " + tr("the peer selected us for high bandwidth relay") + "
  • \"" + + tr("No") + "\" – " + tr("no high bandwidth relay selected") + "
"}; + ui->peerHighBandwidthLabel->setToolTip(ui->peerHighBandwidthLabel->toolTip().arg(hb_list)); ui->dataDir->setToolTip(ui->dataDir->toolTip().arg(QString(nonbreaking_hyphen) + "datadir")); ui->blocksDir->setToolTip(ui->blocksDir->toolTip().arg(QString(nonbreaking_hyphen) + "blocksdir")); ui->openDebugLogfileButton->setToolTip(ui->openDebugLogfileButton->toolTip().arg(PACKAGE_NAME)); @@ -1110,6 +1115,11 @@ void RPCConsole::updateDetailWidget() ui->peerHeading->setText(peerAddrDetails); ui->peerServices->setText(GUIUtil::formatServicesStr(stats->nodeStats.nServices)); ui->peerRelayTxes->setText(stats->nodeStats.fRelayTxes ? "Yes" : "No"); + QString bip152_hb_settings; + if (stats->nodeStats.m_bip152_highbandwidth_to) bip152_hb_settings += "To"; + if (stats->nodeStats.m_bip152_highbandwidth_from) bip152_hb_settings += (bip152_hb_settings == "" ? "From" : "/From"); + if (bip152_hb_settings == "") bip152_hb_settings = "No"; + ui->peerHighBandwidth->setText(bip152_hb_settings); 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")); ui->peerBytesSent->setText(GUIUtil::formatBytes(stats->nodeStats.nSendBytes));