Skip to content

Commit

Permalink
Merge #18402: gui: display mapped AS in peers info window
Browse files Browse the repository at this point in the history
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
  • Loading branch information
laanwj committed Mar 25, 2020
2 parents baa72cd + 76db4b2 commit 244e88e
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 19 deletions.
60 changes: 43 additions & 17 deletions src/qt/forms/debugwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -216,17 +216,17 @@
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="labelNetwork">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Network</string>
</property>
</widget>
<widget class="QLabel" name="labelNetwork">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Network</string>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="label_8">
Expand Down Expand Up @@ -503,12 +503,12 @@
<height>24</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="toolTip">
<string>Decrease font size</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../bitcoin.qrc">
<normaloff>:/icons/fontsmaller</normaloff>:/icons/fontsmaller</iconset>
Expand Down Expand Up @@ -652,12 +652,12 @@
</item>
<item>
<widget class="QLineEdit" name="lineEdit">
<property name="placeholderText">
<string/>
</property>
<property name="enabled">
<bool>false</bool>
</property>
<property name="placeholderText">
<string/>
</property>
</widget>
</item>
</layout>
Expand Down Expand Up @@ -1503,6 +1503,32 @@
</widget>
</item>
<item row="18" column="0">
<widget class="QLabel" name="peerMappedASLabel">
<property name="toolTip">
<string>The mapped Autonomous System used for diversifying peer selection.</string>
</property>
<property name="text">
<string>Mapped AS</string>
</property>
</widget>
</item>
<item row="18" column="1">
<widget class="QLabel" name="peerMappedAS">
<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="19" column="0">
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
Expand Down
5 changes: 3 additions & 2 deletions src/qt/rpcconsole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1113,11 +1113,12 @@ void RPCConsole::updateNodeDetail(const CNodeCombinedStats *stats)
ui->peerPingWait->setText(GUIUtil::formatPingTime(stats->nodeStats.m_ping_wait_usec));
ui->peerMinPing->setText(GUIUtil::formatPingTime(stats->nodeStats.m_min_ping_usec));
ui->timeoffset->setText(GUIUtil::formatTimeOffset(stats->nodeStats.nTimeOffset));
ui->peerVersion->setText(QString("%1").arg(QString::number(stats->nodeStats.nVersion)));
ui->peerVersion->setText(QString::number(stats->nodeStats.nVersion));
ui->peerSubversion->setText(QString::fromStdString(stats->nodeStats.cleanSubVer));
ui->peerDirection->setText(stats->nodeStats.fInbound ? tr("Inbound") : tr("Outbound"));
ui->peerHeight->setText(QString("%1").arg(QString::number(stats->nodeStats.nStartingHeight)));
ui->peerHeight->setText(QString::number(stats->nodeStats.nStartingHeight));
ui->peerWhitelisted->setText(stats->nodeStats.m_legacyWhitelisted ? tr("Yes") : tr("No"));
ui->peerMappedAS->setText(stats->nodeStats.m_mapped_as != 0 ? QString::number(stats->nodeStats.m_mapped_as) : tr("N/A"));

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

0 comments on commit 244e88e

Please sign in to comment.