Skip to content

Commit 08eec69

Browse files
author
MarcoFalke
committed
Merge #206: Display fRelayTxes and bip152_highbandwidth_{to, from} in peer details
142807a gui: display BIP152 high bandwidth relay in peer details (Jon Atack) 9476886 gui: display fRelayTxes in peer details (Jon Atack) Pull request description: This pull adds two fields to the peer details, "Wants Tx Relay" (fRelayTxes) and "High Bandwidth" (bip152_highbandwidth to/from). See the added tooltips for more info. ACKs for top commit: MarcoFalke: review ACK 142807a jarolrod: ACK 142807a Tree-SHA512: 956c7fa54c9c2ea76ee879d370711be0bed4af05484a17d35a1dd77713ed34ff441ed3957d0ef3a7ca7cf59a2f5d898be49b12af609a16b3e3cbfc4a1ba8f54e
2 parents 0e9596c + 142807a commit 08eec69

File tree

2 files changed

+89
-26
lines changed

2 files changed

+89
-26
lines changed

src/qt/forms/debugwindow.ui

Lines changed: 78 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1198,13 +1198,65 @@
11981198
</widget>
11991199
</item>
12001200
<item row="6" column="0">
1201+
<widget class="QLabel" name="peerRelayTxesLabel">
1202+
<property name="toolTip">
1203+
<string>Whether the peer requested us to relay transactions.</string>
1204+
</property>
1205+
<property name="text">
1206+
<string>Wants Tx Relay</string>
1207+
</property>
1208+
</widget>
1209+
</item>
1210+
<item row="6" column="1">
1211+
<widget class="QLabel" name="peerRelayTxes">
1212+
<property name="cursor">
1213+
<cursorShape>IBeamCursor</cursorShape>
1214+
</property>
1215+
<property name="text">
1216+
<string>N/A</string>
1217+
</property>
1218+
<property name="textFormat">
1219+
<enum>Qt::PlainText</enum>
1220+
</property>
1221+
<property name="textInteractionFlags">
1222+
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
1223+
</property>
1224+
</widget>
1225+
</item>
1226+
<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">
12011253
<widget class="QLabel" name="label_29">
12021254
<property name="text">
12031255
<string>Starting Block</string>
12041256
</property>
12051257
</widget>
12061258
</item>
1207-
<item row="6" column="1">
1259+
<item row="8" column="1">
12081260
<widget class="QLabel" name="peerHeight">
12091261
<property name="cursor">
12101262
<cursorShape>IBeamCursor</cursorShape>
@@ -1220,14 +1272,14 @@
12201272
</property>
12211273
</widget>
12221274
</item>
1223-
<item row="7" column="0">
1275+
<item row="9" column="0">
12241276
<widget class="QLabel" name="label_27">
12251277
<property name="text">
12261278
<string>Synced Headers</string>
12271279
</property>
12281280
</widget>
12291281
</item>
1230-
<item row="7" column="1">
1282+
<item row="9" column="1">
12311283
<widget class="QLabel" name="peerSyncHeight">
12321284
<property name="cursor">
12331285
<cursorShape>IBeamCursor</cursorShape>
@@ -1243,14 +1295,14 @@
12431295
</property>
12441296
</widget>
12451297
</item>
1246-
<item row="8" column="0">
1298+
<item row="10" column="0">
12471299
<widget class="QLabel" name="label_25">
12481300
<property name="text">
12491301
<string>Synced Blocks</string>
12501302
</property>
12511303
</widget>
12521304
</item>
1253-
<item row="8" column="1">
1305+
<item row="10" column="1">
12541306
<widget class="QLabel" name="peerCommonHeight">
12551307
<property name="cursor">
12561308
<cursorShape>IBeamCursor</cursorShape>
@@ -1266,14 +1318,14 @@
12661318
</property>
12671319
</widget>
12681320
</item>
1269-
<item row="9" column="0">
1321+
<item row="11" column="0">
12701322
<widget class="QLabel" name="label_22">
12711323
<property name="text">
12721324
<string>Connection Time</string>
12731325
</property>
12741326
</widget>
12751327
</item>
1276-
<item row="9" column="1">
1328+
<item row="11" column="1">
12771329
<widget class="QLabel" name="peerConnTime">
12781330
<property name="cursor">
12791331
<cursorShape>IBeamCursor</cursorShape>
@@ -1289,14 +1341,14 @@
12891341
</property>
12901342
</widget>
12911343
</item>
1292-
<item row="10" column="0">
1344+
<item row="12" column="0">
12931345
<widget class="QLabel" name="label_15">
12941346
<property name="text">
12951347
<string>Last Send</string>
12961348
</property>
12971349
</widget>
12981350
</item>
1299-
<item row="10" column="1">
1351+
<item row="12" column="1">
13001352
<widget class="QLabel" name="peerLastSend">
13011353
<property name="cursor">
13021354
<cursorShape>IBeamCursor</cursorShape>
@@ -1312,14 +1364,14 @@
13121364
</property>
13131365
</widget>
13141366
</item>
1315-
<item row="11" column="0">
1367+
<item row="13" column="0">
13161368
<widget class="QLabel" name="label_19">
13171369
<property name="text">
13181370
<string>Last Receive</string>
13191371
</property>
13201372
</widget>
13211373
</item>
1322-
<item row="11" column="1">
1374+
<item row="13" column="1">
13231375
<widget class="QLabel" name="peerLastRecv">
13241376
<property name="cursor">
13251377
<cursorShape>IBeamCursor</cursorShape>
@@ -1335,14 +1387,14 @@
13351387
</property>
13361388
</widget>
13371389
</item>
1338-
<item row="12" column="0">
1390+
<item row="14" column="0">
13391391
<widget class="QLabel" name="label_18">
13401392
<property name="text">
13411393
<string>Sent</string>
13421394
</property>
13431395
</widget>
13441396
</item>
1345-
<item row="12" column="1">
1397+
<item row="14" column="1">
13461398
<widget class="QLabel" name="peerBytesSent">
13471399
<property name="cursor">
13481400
<cursorShape>IBeamCursor</cursorShape>
@@ -1358,14 +1410,14 @@
13581410
</property>
13591411
</widget>
13601412
</item>
1361-
<item row="13" column="0">
1413+
<item row="15" column="0">
13621414
<widget class="QLabel" name="label_20">
13631415
<property name="text">
13641416
<string>Received</string>
13651417
</property>
13661418
</widget>
13671419
</item>
1368-
<item row="13" column="1">
1420+
<item row="15" column="1">
13691421
<widget class="QLabel" name="peerBytesRecv">
13701422
<property name="cursor">
13711423
<cursorShape>IBeamCursor</cursorShape>
@@ -1381,14 +1433,14 @@
13811433
</property>
13821434
</widget>
13831435
</item>
1384-
<item row="14" column="0">
1436+
<item row="16" column="0">
13851437
<widget class="QLabel" name="label_26">
13861438
<property name="text">
13871439
<string>Ping Time</string>
13881440
</property>
13891441
</widget>
13901442
</item>
1391-
<item row="14" column="1">
1443+
<item row="16" column="1">
13921444
<widget class="QLabel" name="peerPingTime">
13931445
<property name="cursor">
13941446
<cursorShape>IBeamCursor</cursorShape>
@@ -1404,7 +1456,7 @@
14041456
</property>
14051457
</widget>
14061458
</item>
1407-
<item row="15" column="0">
1459+
<item row="17" column="0">
14081460
<widget class="QLabel" name="peerPingWaitLabel">
14091461
<property name="toolTip">
14101462
<string>The duration of a currently outstanding ping.</string>
@@ -1414,7 +1466,7 @@
14141466
</property>
14151467
</widget>
14161468
</item>
1417-
<item row="15" column="1">
1469+
<item row="17" column="1">
14181470
<widget class="QLabel" name="peerPingWait">
14191471
<property name="cursor">
14201472
<cursorShape>IBeamCursor</cursorShape>
@@ -1430,14 +1482,14 @@
14301482
</property>
14311483
</widget>
14321484
</item>
1433-
<item row="16" column="0">
1485+
<item row="18" column="0">
14341486
<widget class="QLabel" name="peerMinPingLabel">
14351487
<property name="text">
14361488
<string>Min Ping</string>
14371489
</property>
14381490
</widget>
14391491
</item>
1440-
<item row="16" column="1">
1492+
<item row="18" column="1">
14411493
<widget class="QLabel" name="peerMinPing">
14421494
<property name="cursor">
14431495
<cursorShape>IBeamCursor</cursorShape>
@@ -1453,14 +1505,14 @@
14531505
</property>
14541506
</widget>
14551507
</item>
1456-
<item row="17" column="0">
1508+
<item row="19" column="0">
14571509
<widget class="QLabel" name="label_timeoffset">
14581510
<property name="text">
14591511
<string>Time Offset</string>
14601512
</property>
14611513
</widget>
14621514
</item>
1463-
<item row="17" column="1">
1515+
<item row="19" column="1">
14641516
<widget class="QLabel" name="timeoffset">
14651517
<property name="cursor">
14661518
<cursorShape>IBeamCursor</cursorShape>
@@ -1476,7 +1528,7 @@
14761528
</property>
14771529
</widget>
14781530
</item>
1479-
<item row="18" column="0">
1531+
<item row="20" column="0">
14801532
<widget class="QLabel" name="peerMappedASLabel">
14811533
<property name="toolTip">
14821534
<string>The mapped Autonomous System used for diversifying peer selection.</string>
@@ -1486,7 +1538,7 @@
14861538
</property>
14871539
</widget>
14881540
</item>
1489-
<item row="18" column="1">
1541+
<item row="20" column="1">
14901542
<widget class="QLabel" name="peerMappedAS">
14911543
<property name="cursor">
14921544
<cursorShape>IBeamCursor</cursorShape>
@@ -1502,7 +1554,7 @@
15021554
</property>
15031555
</widget>
15041556
</item>
1505-
<item row="19" column="0">
1557+
<item row="21" column="0">
15061558
<spacer name="verticalSpacer_3">
15071559
<property name="orientation">
15081560
<enum>Qt::Vertical</enum>

src/qt/rpcconsole.cpp

Lines changed: 11 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));
@@ -1109,6 +1114,12 @@ void RPCConsole::updateDetailWidget()
11091114
peerAddrDetails += "<br />" + tr("via %1").arg(QString::fromStdString(stats->nodeStats.addrLocal));
11101115
ui->peerHeading->setText(peerAddrDetails);
11111116
ui->peerServices->setText(GUIUtil::formatServicesStr(stats->nodeStats.nServices));
1117+
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);
11121123
ui->peerLastSend->setText(stats->nodeStats.nLastSend ? GUIUtil::formatDurationStr(GetSystemTimeInSeconds() - stats->nodeStats.nLastSend) : tr("never"));
11131124
ui->peerLastRecv->setText(stats->nodeStats.nLastRecv ? GUIUtil::formatDurationStr(GetSystemTimeInSeconds() - stats->nodeStats.nLastRecv) : tr("never"));
11141125
ui->peerBytesSent->setText(GUIUtil::formatBytes(stats->nodeStats.nSendBytes));

0 commit comments

Comments
 (0)