Skip to content

Commit 142807a

Browse files
committed
gui: display BIP152 high bandwidth relay in peer details
1 parent 9476886 commit 142807a

File tree

2 files changed

+62
-26
lines changed

2 files changed

+62
-26
lines changed

src/qt/forms/debugwindow.ui

Lines changed: 52 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1224,13 +1224,39 @@
12241224
</widget>
12251225
</item>
12261226
<item row="7" column="0">
1227+
<widget class="QLabel" name="peerHighBandwidthLabel">
1228+
<property name="toolTip">
1229+
<string>High bandwidth BIP152 compact block relay: %1</string>
1230+
</property>
1231+
<property name="text">
1232+
<string>High Bandwidth</string>
1233+
</property>
1234+
</widget>
1235+
</item>
1236+
<item row="7" column="1">
1237+
<widget class="QLabel" name="peerHighBandwidth">
1238+
<property name="cursor">
1239+
<cursorShape>IBeamCursor</cursorShape>
1240+
</property>
1241+
<property name="text">
1242+
<string>N/A</string>
1243+
</property>
1244+
<property name="textFormat">
1245+
<enum>Qt::PlainText</enum>
1246+
</property>
1247+
<property name="textInteractionFlags">
1248+
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
1249+
</property>
1250+
</widget>
1251+
</item>
1252+
<item row="8" column="0">
12271253
<widget class="QLabel" name="label_29">
12281254
<property name="text">
12291255
<string>Starting Block</string>
12301256
</property>
12311257
</widget>
12321258
</item>
1233-
<item row="7" column="1">
1259+
<item row="8" column="1">
12341260
<widget class="QLabel" name="peerHeight">
12351261
<property name="cursor">
12361262
<cursorShape>IBeamCursor</cursorShape>
@@ -1246,14 +1272,14 @@
12461272
</property>
12471273
</widget>
12481274
</item>
1249-
<item row="8" column="0">
1275+
<item row="9" column="0">
12501276
<widget class="QLabel" name="label_27">
12511277
<property name="text">
12521278
<string>Synced Headers</string>
12531279
</property>
12541280
</widget>
12551281
</item>
1256-
<item row="8" column="1">
1282+
<item row="9" column="1">
12571283
<widget class="QLabel" name="peerSyncHeight">
12581284
<property name="cursor">
12591285
<cursorShape>IBeamCursor</cursorShape>
@@ -1269,14 +1295,14 @@
12691295
</property>
12701296
</widget>
12711297
</item>
1272-
<item row="9" column="0">
1298+
<item row="10" column="0">
12731299
<widget class="QLabel" name="label_25">
12741300
<property name="text">
12751301
<string>Synced Blocks</string>
12761302
</property>
12771303
</widget>
12781304
</item>
1279-
<item row="9" column="1">
1305+
<item row="10" column="1">
12801306
<widget class="QLabel" name="peerCommonHeight">
12811307
<property name="cursor">
12821308
<cursorShape>IBeamCursor</cursorShape>
@@ -1292,14 +1318,14 @@
12921318
</property>
12931319
</widget>
12941320
</item>
1295-
<item row="10" column="0">
1321+
<item row="11" column="0">
12961322
<widget class="QLabel" name="label_22">
12971323
<property name="text">
12981324
<string>Connection Time</string>
12991325
</property>
13001326
</widget>
13011327
</item>
1302-
<item row="10" column="1">
1328+
<item row="11" column="1">
13031329
<widget class="QLabel" name="peerConnTime">
13041330
<property name="cursor">
13051331
<cursorShape>IBeamCursor</cursorShape>
@@ -1315,14 +1341,14 @@
13151341
</property>
13161342
</widget>
13171343
</item>
1318-
<item row="11" column="0">
1344+
<item row="12" column="0">
13191345
<widget class="QLabel" name="label_15">
13201346
<property name="text">
13211347
<string>Last Send</string>
13221348
</property>
13231349
</widget>
13241350
</item>
1325-
<item row="11" column="1">
1351+
<item row="12" column="1">
13261352
<widget class="QLabel" name="peerLastSend">
13271353
<property name="cursor">
13281354
<cursorShape>IBeamCursor</cursorShape>
@@ -1338,14 +1364,14 @@
13381364
</property>
13391365
</widget>
13401366
</item>
1341-
<item row="12" column="0">
1367+
<item row="13" column="0">
13421368
<widget class="QLabel" name="label_19">
13431369
<property name="text">
13441370
<string>Last Receive</string>
13451371
</property>
13461372
</widget>
13471373
</item>
1348-
<item row="12" column="1">
1374+
<item row="13" column="1">
13491375
<widget class="QLabel" name="peerLastRecv">
13501376
<property name="cursor">
13511377
<cursorShape>IBeamCursor</cursorShape>
@@ -1361,14 +1387,14 @@
13611387
</property>
13621388
</widget>
13631389
</item>
1364-
<item row="13" column="0">
1390+
<item row="14" column="0">
13651391
<widget class="QLabel" name="label_18">
13661392
<property name="text">
13671393
<string>Sent</string>
13681394
</property>
13691395
</widget>
13701396
</item>
1371-
<item row="13" column="1">
1397+
<item row="14" column="1">
13721398
<widget class="QLabel" name="peerBytesSent">
13731399
<property name="cursor">
13741400
<cursorShape>IBeamCursor</cursorShape>
@@ -1384,14 +1410,14 @@
13841410
</property>
13851411
</widget>
13861412
</item>
1387-
<item row="14" column="0">
1413+
<item row="15" column="0">
13881414
<widget class="QLabel" name="label_20">
13891415
<property name="text">
13901416
<string>Received</string>
13911417
</property>
13921418
</widget>
13931419
</item>
1394-
<item row="14" column="1">
1420+
<item row="15" column="1">
13951421
<widget class="QLabel" name="peerBytesRecv">
13961422
<property name="cursor">
13971423
<cursorShape>IBeamCursor</cursorShape>
@@ -1407,14 +1433,14 @@
14071433
</property>
14081434
</widget>
14091435
</item>
1410-
<item row="15" column="0">
1436+
<item row="16" column="0">
14111437
<widget class="QLabel" name="label_26">
14121438
<property name="text">
14131439
<string>Ping Time</string>
14141440
</property>
14151441
</widget>
14161442
</item>
1417-
<item row="15" column="1">
1443+
<item row="16" column="1">
14181444
<widget class="QLabel" name="peerPingTime">
14191445
<property name="cursor">
14201446
<cursorShape>IBeamCursor</cursorShape>
@@ -1430,7 +1456,7 @@
14301456
</property>
14311457
</widget>
14321458
</item>
1433-
<item row="16" column="0">
1459+
<item row="17" column="0">
14341460
<widget class="QLabel" name="peerPingWaitLabel">
14351461
<property name="toolTip">
14361462
<string>The duration of a currently outstanding ping.</string>
@@ -1440,7 +1466,7 @@
14401466
</property>
14411467
</widget>
14421468
</item>
1443-
<item row="16" column="1">
1469+
<item row="17" column="1">
14441470
<widget class="QLabel" name="peerPingWait">
14451471
<property name="cursor">
14461472
<cursorShape>IBeamCursor</cursorShape>
@@ -1456,14 +1482,14 @@
14561482
</property>
14571483
</widget>
14581484
</item>
1459-
<item row="17" column="0">
1485+
<item row="18" column="0">
14601486
<widget class="QLabel" name="peerMinPingLabel">
14611487
<property name="text">
14621488
<string>Min Ping</string>
14631489
</property>
14641490
</widget>
14651491
</item>
1466-
<item row="17" column="1">
1492+
<item row="18" column="1">
14671493
<widget class="QLabel" name="peerMinPing">
14681494
<property name="cursor">
14691495
<cursorShape>IBeamCursor</cursorShape>
@@ -1479,14 +1505,14 @@
14791505
</property>
14801506
</widget>
14811507
</item>
1482-
<item row="18" column="0">
1508+
<item row="19" column="0">
14831509
<widget class="QLabel" name="label_timeoffset">
14841510
<property name="text">
14851511
<string>Time Offset</string>
14861512
</property>
14871513
</widget>
14881514
</item>
1489-
<item row="18" column="1">
1515+
<item row="19" column="1">
14901516
<widget class="QLabel" name="timeoffset">
14911517
<property name="cursor">
14921518
<cursorShape>IBeamCursor</cursorShape>
@@ -1502,7 +1528,7 @@
15021528
</property>
15031529
</widget>
15041530
</item>
1505-
<item row="19" column="0">
1531+
<item row="20" column="0">
15061532
<widget class="QLabel" name="peerMappedASLabel">
15071533
<property name="toolTip">
15081534
<string>The mapped Autonomous System used for diversifying peer selection.</string>
@@ -1512,7 +1538,7 @@
15121538
</property>
15131539
</widget>
15141540
</item>
1515-
<item row="19" column="1">
1541+
<item row="20" column="1">
15161542
<widget class="QLabel" name="peerMappedAS">
15171543
<property name="cursor">
15181544
<cursorShape>IBeamCursor</cursorShape>
@@ -1528,7 +1554,7 @@
15281554
</property>
15291555
</widget>
15301556
</item>
1531-
<item row="20" column="0">
1557+
<item row="21" column="0">
15321558
<spacer name="verticalSpacer_3">
15331559
<property name="orientation">
15341560
<enum>Qt::Vertical</enum>

src/qt/rpcconsole.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,11 @@ RPCConsole::RPCConsole(interfaces::Node& node, const PlatformStyle *_platformSty
473473
tr("Outbound Address Fetch: short-lived, for soliciting addresses")};
474474
const QString list{"<ul><li>" + Join(CONNECTION_TYPE_DOC, QString("</li><li>")) + "</li></ul>"};
475475
ui->peerConnectionTypeLabel->setToolTip(ui->peerConnectionTypeLabel->toolTip().arg(list));
476+
const QString hb_list{"<ul><li>\""
477+
+ tr("To") + "\"" + tr("we selected the peer for high bandwidth relay") + "</li><li>\""
478+
+ tr("From") + "\"" + tr("the peer selected us for high bandwidth relay") + "</li><li>\""
479+
+ tr("No") + "\"" + tr("no high bandwidth relay selected") + "</li></ul>"};
480+
ui->peerHighBandwidthLabel->setToolTip(ui->peerHighBandwidthLabel->toolTip().arg(hb_list));
476481
ui->dataDir->setToolTip(ui->dataDir->toolTip().arg(QString(nonbreaking_hyphen) + "datadir"));
477482
ui->blocksDir->setToolTip(ui->blocksDir->toolTip().arg(QString(nonbreaking_hyphen) + "blocksdir"));
478483
ui->openDebugLogfileButton->setToolTip(ui->openDebugLogfileButton->toolTip().arg(PACKAGE_NAME));
@@ -1110,6 +1115,11 @@ void RPCConsole::updateDetailWidget()
11101115
ui->peerHeading->setText(peerAddrDetails);
11111116
ui->peerServices->setText(GUIUtil::formatServicesStr(stats->nodeStats.nServices));
11121117
ui->peerRelayTxes->setText(stats->nodeStats.fRelayTxes ? "Yes" : "No");
1118+
QString bip152_hb_settings;
1119+
if (stats->nodeStats.m_bip152_highbandwidth_to) bip152_hb_settings += "To";
1120+
if (stats->nodeStats.m_bip152_highbandwidth_from) bip152_hb_settings += (bip152_hb_settings == "" ? "From" : "/From");
1121+
if (bip152_hb_settings == "") bip152_hb_settings = "No";
1122+
ui->peerHighBandwidth->setText(bip152_hb_settings);
11131123
ui->peerLastSend->setText(stats->nodeStats.nLastSend ? GUIUtil::formatDurationStr(GetSystemTimeInSeconds() - stats->nodeStats.nLastSend) : tr("never"));
11141124
ui->peerLastRecv->setText(stats->nodeStats.nLastRecv ? GUIUtil::formatDurationStr(GetSystemTimeInSeconds() - stats->nodeStats.nLastRecv) : tr("never"));
11151125
ui->peerBytesSent->setText(GUIUtil::formatBytes(stats->nodeStats.nSendBytes));

0 commit comments

Comments
 (0)