Skip to content

Commit

Permalink
merge bitcoin-core/gui#206: Display fRelayTxes and bip152_highbandwid…
Browse files Browse the repository at this point in the history
…th_{to, from} in peer details

continuation of 3e8ba24 from dash#5964

includes:
- 142807a
  • Loading branch information
kwvg committed Jun 10, 2024
1 parent 2390621 commit 1cbf3b9
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 36 deletions.
98 changes: 62 additions & 36 deletions src/qt/forms/debugwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -1150,13 +1150,39 @@
</widget>
</item>
<item row="9" column="0">
<widget class="QLabel" name="peerHighBandwidthLabel">
<property name="toolTip">
<string>High bandwidth BIP152 compact block relay: %1</string>
</property>
<property name="text">
<string>High Bandwidth</string>
</property>
</widget>
</item>
<item row="9" column="2">
<widget class="QLabel" name="peerHighBandwidth">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
</property>
<property name="text">
<string>N/A</string>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="10" column="0">
<widget class="QLabel" name="label_29">
<property name="text">
<string>Starting Block</string>
</property>
</widget>
</item>
<item row="9" column="2">
<item row="10" column="2">
<widget class="QLabel" name="peerHeight">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
Expand All @@ -1172,14 +1198,14 @@
</property>
</widget>
</item>
<item row="10" column="0">
<item row="11" column="0">
<widget class="QLabel" name="label_27">
<property name="text">
<string>Synced Headers</string>
</property>
</widget>
</item>
<item row="10" column="2">
<item row="11" column="2">
<widget class="QLabel" name="peerSyncHeight">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
Expand All @@ -1195,14 +1221,14 @@
</property>
</widget>
</item>
<item row="11" column="0">
<item row="12" column="0">
<widget class="QLabel" name="label_25">
<property name="text">
<string>Synced Blocks</string>
</property>
</widget>
</item>
<item row="11" column="2">
<item row="12" column="2">
<widget class="QLabel" name="peerCommonHeight">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
Expand All @@ -1218,14 +1244,14 @@
</property>
</widget>
</item>
<item row="12" column="0">
<item row="13" column="0">
<widget class="QLabel" name="label_22">
<property name="text">
<string>Connection Time</string>
</property>
</widget>
</item>
<item row="12" column="2">
<item row="13" column="2">
<widget class="QLabel" name="peerConnTime">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
Expand All @@ -1241,7 +1267,7 @@
</property>
</widget>
</item>
<item row="13" column="0">
<item row="14" column="0">
<widget class="QLabel" name="peerLastBlockLabel">
<property name="toolTip">
<string>Elapsed time since a novel block passing initial validity checks was received from this peer.</string>
Expand All @@ -1251,7 +1277,7 @@
</property>
</widget>
</item>
<item row="13" column="2">
<item row="14" column="2">
<widget class="QLabel" name="peerLastBlock">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
Expand All @@ -1267,7 +1293,7 @@
</property>
</widget>
</item>
<item row="14" column="0">
<item row="15" column="0">
<widget class="QLabel" name="peerLastTxLabel">
<property name="toolTip">
<string extracomment="Tooltip text for the Last Transaction field in the peer details area.">Elapsed time since a novel transaction accepted into our mempool was received from this peer.</string>
Expand All @@ -1277,7 +1303,7 @@
</property>
</widget>
</item>
<item row="14" column="2">
<item row="15" column="2">
<widget class="QLabel" name="peerLastTx">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
Expand All @@ -1293,14 +1319,14 @@
</property>
</widget>
</item>
<item row="15" column="0">
<item row="16" column="0">
<widget class="QLabel" name="label_15">
<property name="text">
<string>Last Send</string>
</property>
</widget>
</item>
<item row="15" column="2">
<item row="16" column="2">
<widget class="QLabel" name="peerLastSend">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
Expand All @@ -1316,14 +1342,14 @@
</property>
</widget>
</item>
<item row="16" column="0">
<item row="17" column="0">
<widget class="QLabel" name="label_19">
<property name="text">
<string>Last Receive</string>
</property>
</widget>
</item>
<item row="16" column="2">
<item row="17" column="2">
<widget class="QLabel" name="peerLastRecv">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
Expand All @@ -1339,14 +1365,14 @@
</property>
</widget>
</item>
<item row="17" column="0">
<item row="18" column="0">
<widget class="QLabel" name="label_18">
<property name="text">
<string>Sent</string>
</property>
</widget>
</item>
<item row="17" column="2">
<item row="18" column="2">
<widget class="QLabel" name="peerBytesSent">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
Expand All @@ -1362,14 +1388,14 @@
</property>
</widget>
</item>
<item row="18" column="0">
<item row="19" column="0">
<widget class="QLabel" name="label_20">
<property name="text">
<string>Received</string>
</property>
</widget>
</item>
<item row="18" column="2">
<item row="19" column="2">
<widget class="QLabel" name="peerBytesRecv">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
Expand All @@ -1385,14 +1411,14 @@
</property>
</widget>
</item>
<item row="19" column="0">
<item row="20" column="0">
<widget class="QLabel" name="label_26">
<property name="text">
<string>Ping Time</string>
</property>
</widget>
</item>
<item row="19" column="2">
<item row="20" column="2">
<widget class="QLabel" name="peerPingTime">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
Expand All @@ -1408,7 +1434,7 @@
</property>
</widget>
</item>
<item row="20" column="0">
<item row="21" column="0">
<widget class="QLabel" name="peerPingWaitLabel">
<property name="toolTip">
<string>The duration of a currently outstanding ping.</string>
Expand All @@ -1418,7 +1444,7 @@
</property>
</widget>
</item>
<item row="20" column="2">
<item row="21" column="2">
<widget class="QLabel" name="peerPingWait">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
Expand All @@ -1434,14 +1460,14 @@
</property>
</widget>
</item>
<item row="21" column="0">
<item row="22" column="0">
<widget class="QLabel" name="peerMinPingLabel">
<property name="text">
<string>Min Ping</string>
</property>
</widget>
</item>
<item row="21" column="2">
<item row="22" column="2">
<widget class="QLabel" name="peerMinPing">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
Expand All @@ -1457,14 +1483,14 @@
</property>
</widget>
</item>
<item row="22" column="0">
<item row="23" column="0">
<widget class="QLabel" name="label_timeoffset">
<property name="text">
<string>Time Offset</string>
</property>
</widget>
</item>
<item row="22" column="2">
<item row="23" column="2">
<widget class="QLabel" name="timeoffset">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
Expand All @@ -1480,7 +1506,7 @@
</property>
</widget>
</item>
<item row="23" column="0">
<item row="24" column="0">
<widget class="QLabel" name="peerMappedASLabel">
<property name="toolTip">
<string>The mapped Autonomous System used for diversifying peer selection.</string>
Expand All @@ -1490,7 +1516,7 @@
</property>
</widget>
</item>
<item row="23" column="2">
<item row="24" column="2">
<widget class="QLabel" name="peerMappedAS">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
Expand All @@ -1506,7 +1532,7 @@
</property>
</widget>
</item>
<item row="24" column="0">
<item row="25" column="0">
<widget class="QLabel" name="peerAddrRelayEnabledLabel">
<property name="toolTip">
<string extracomment="Tooltip text for the Address Relay field in the peer details area.">Whether we relay addresses to this peer.</string>
Expand All @@ -1516,7 +1542,7 @@
</property>
</widget>
</item>
<item row="24" column="2">
<item row="25" column="2">
<widget class="QLabel" name="peerAddrRelayEnabled">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
Expand All @@ -1532,7 +1558,7 @@
</property>
</widget>
</item>
<item row="25" column="0">
<item row="26" column="0">
<widget class="QLabel" name="peerAddrProcessedLabel">
<property name="toolTip">
<string extracomment="Tooltip text for the Addresses Processed field in the peer details area.">Total number of addresses processed, excluding those dropped due to rate-limiting.</string>
Expand All @@ -1542,7 +1568,7 @@
</property>
</widget>
</item>
<item row="25" column="2">
<item row="26" column="2">
<widget class="QLabel" name="peerAddrProcessed">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
Expand All @@ -1558,7 +1584,7 @@
</property>
</widget>
</item>
<item row="26" column="0">
<item row="27" column="0">
<widget class="QLabel" name="peerAddrRateLimitedLabel">
<property name="toolTip">
<string extracomment="Tooltip text for the Addresses Rate-Limited field in the peer details area.">Total number of addresses dropped due to rate-limiting.</string>
Expand All @@ -1568,7 +1594,7 @@
</property>
</widget>
</item>
<item row="26" column="2">
<item row="27" column="2">
<widget class="QLabel" name="peerAddrRateLimited">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
Expand All @@ -1584,7 +1610,7 @@
</property>
</widget>
</item>
<item row="27" column="0">
<item row="28" column="0">
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
Expand Down
10 changes: 10 additions & 0 deletions src/qt/rpcconsole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,11 @@ RPCConsole::RPCConsole(interfaces::Node& node, QWidget* parent, Qt::WindowFlags
tr("Outbound Address Fetch: short-lived, for soliciting addresses")};
const QString list{"<ul><li>" + Join(CONNECTION_TYPE_DOC, QString("</li><li>")) + "</li></ul>"};
ui->peerConnectionTypeLabel->setToolTip(ui->peerConnectionTypeLabel->toolTip().arg(list));
const QString hb_list{"<ul><li>\""
+ tr("To") + "\"" + tr("we selected the peer for high bandwidth relay") + "</li><li>\""
+ tr("From") + "\"" + tr("the peer selected us for high bandwidth relay") + "</li><li>\""
+ tr("No") + "\"" + tr("no high bandwidth relay selected") + "</li></ul>"};
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));
Expand Down Expand Up @@ -1279,6 +1284,11 @@ void RPCConsole::updateDetailWidget()
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}));
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(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));
Expand Down

0 comments on commit 1cbf3b9

Please sign in to comment.