Skip to content

Commit 244e88e

Browse files
committed
Merge #18402: gui: display mapped AS in peers info window
76db4b2 gui: avoid QT Designer/Form Editor re-formatting (Jon Atack) aae2605 gui: display Mapped AS in peers info window (Jon Atack) Pull request description: Continuing the asmap integration of #16702 which added `mapped_as` to the rpc getpeerinfo output, this adds the mapped AS to the Peers detail window in the GUI wallet. `$ src/qt/bitcoin-qt -asmap=<path-to-asmap-file>` (asmap on) ![Screenshot from 2020-03-22 12-29-56](https://user-images.githubusercontent.com/2415484/77248754-c0ae4600-6c33-11ea-9d27-a06560c180c0.jpg) `$ src/qt/bitcoin-qt` (asmap off) ![Screenshot from 2020-03-22 12-32-46](https://user-images.githubusercontent.com/2415484/77248749-bdb35580-6c33-11ea-925c-6e19ecc083ab.jpg) Added a tooltip and a couple of minor fixups. ACKs for top commit: laanwj: ACK 76db4b2 Tree-SHA512: 5f44c05c247bfabc9c161884d3af47c50a571cd02777b320ce389e61efa47706adbf0ea5e6644ae40423cb579d8bd0bb3c84fc6b618293a7add8e4327f07f63f
2 parents baa72cd + 76db4b2 commit 244e88e

File tree

2 files changed

+46
-19
lines changed

2 files changed

+46
-19
lines changed

src/qt/forms/debugwindow.ui

Lines changed: 43 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -216,17 +216,17 @@
216216
</widget>
217217
</item>
218218
<item row="7" column="0">
219-
<widget class="QLabel" name="labelNetwork">
220-
<property name="font">
221-
<font>
222-
<weight>75</weight>
223-
<bold>true</bold>
224-
</font>
225-
</property>
226-
<property name="text">
227-
<string>Network</string>
228-
</property>
229-
</widget>
219+
<widget class="QLabel" name="labelNetwork">
220+
<property name="font">
221+
<font>
222+
<weight>75</weight>
223+
<bold>true</bold>
224+
</font>
225+
</property>
226+
<property name="text">
227+
<string>Network</string>
228+
</property>
229+
</widget>
230230
</item>
231231
<item row="8" column="0">
232232
<widget class="QLabel" name="label_8">
@@ -503,12 +503,12 @@
503503
<height>24</height>
504504
</size>
505505
</property>
506-
<property name="text">
507-
<string/>
508-
</property>
509506
<property name="toolTip">
510507
<string>Decrease font size</string>
511508
</property>
509+
<property name="text">
510+
<string/>
511+
</property>
512512
<property name="icon">
513513
<iconset resource="../bitcoin.qrc">
514514
<normaloff>:/icons/fontsmaller</normaloff>:/icons/fontsmaller</iconset>
@@ -652,12 +652,12 @@
652652
</item>
653653
<item>
654654
<widget class="QLineEdit" name="lineEdit">
655-
<property name="placeholderText">
656-
<string/>
657-
</property>
658655
<property name="enabled">
659656
<bool>false</bool>
660657
</property>
658+
<property name="placeholderText">
659+
<string/>
660+
</property>
661661
</widget>
662662
</item>
663663
</layout>
@@ -1503,6 +1503,32 @@
15031503
</widget>
15041504
</item>
15051505
<item row="18" column="0">
1506+
<widget class="QLabel" name="peerMappedASLabel">
1507+
<property name="toolTip">
1508+
<string>The mapped Autonomous System used for diversifying peer selection.</string>
1509+
</property>
1510+
<property name="text">
1511+
<string>Mapped AS</string>
1512+
</property>
1513+
</widget>
1514+
</item>
1515+
<item row="18" column="1">
1516+
<widget class="QLabel" name="peerMappedAS">
1517+
<property name="cursor">
1518+
<cursorShape>IBeamCursor</cursorShape>
1519+
</property>
1520+
<property name="text">
1521+
<string>N/A</string>
1522+
</property>
1523+
<property name="textFormat">
1524+
<enum>Qt::PlainText</enum>
1525+
</property>
1526+
<property name="textInteractionFlags">
1527+
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
1528+
</property>
1529+
</widget>
1530+
</item>
1531+
<item row="19" column="0">
15061532
<spacer name="verticalSpacer_3">
15071533
<property name="orientation">
15081534
<enum>Qt::Vertical</enum>

src/qt/rpcconsole.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,11 +1113,12 @@ void RPCConsole::updateNodeDetail(const CNodeCombinedStats *stats)
11131113
ui->peerPingWait->setText(GUIUtil::formatPingTime(stats->nodeStats.m_ping_wait_usec));
11141114
ui->peerMinPing->setText(GUIUtil::formatPingTime(stats->nodeStats.m_min_ping_usec));
11151115
ui->timeoffset->setText(GUIUtil::formatTimeOffset(stats->nodeStats.nTimeOffset));
1116-
ui->peerVersion->setText(QString("%1").arg(QString::number(stats->nodeStats.nVersion)));
1116+
ui->peerVersion->setText(QString::number(stats->nodeStats.nVersion));
11171117
ui->peerSubversion->setText(QString::fromStdString(stats->nodeStats.cleanSubVer));
11181118
ui->peerDirection->setText(stats->nodeStats.fInbound ? tr("Inbound") : tr("Outbound"));
1119-
ui->peerHeight->setText(QString("%1").arg(QString::number(stats->nodeStats.nStartingHeight)));
1119+
ui->peerHeight->setText(QString::number(stats->nodeStats.nStartingHeight));
11201120
ui->peerWhitelisted->setText(stats->nodeStats.m_legacyWhitelisted ? tr("Yes") : tr("No"));
1121+
ui->peerMappedAS->setText(stats->nodeStats.m_mapped_as != 0 ? QString::number(stats->nodeStats.m_mapped_as) : tr("N/A"));
11211122

11221123
// This check fails for example if the lock was busy and
11231124
// nodeStateStats couldn't be fetched.

0 commit comments

Comments
 (0)