From f08adec886febbfe038cedc32970c27c6f72bd5f Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Tue, 3 Oct 2023 10:18:51 +0100 Subject: qt: Add "Transport" label to peer details --- src/qt/forms/debugwindow.ui | 122 +++++++++++++++++++++++++++----------------- src/qt/rpcconsole.cpp | 15 +++++- 2 files changed, 87 insertions(+), 50 deletions(-) (limited to 'src/qt') diff --git a/src/qt/forms/debugwindow.ui b/src/qt/forms/debugwindow.ui index f1b66341d1..5cdba64378 100644 --- a/src/qt/forms/debugwindow.ui +++ b/src/qt/forms/debugwindow.ui @@ -1085,6 +1085,32 @@ + + + The transport layer version: %1 + + + Transport + + + + + + + IBeamCursor + + + N/A + + + Qt::PlainText + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + The network protocol this peer is connected through: IPv4, IPv6, Onion, I2P, or CJDNS. @@ -1094,7 +1120,7 @@ - + IBeamCursor @@ -1110,14 +1136,14 @@ - + Version - + IBeamCursor @@ -1133,14 +1159,14 @@ - + User Agent - + IBeamCursor @@ -1156,14 +1182,14 @@ - + Services - + IBeamCursor @@ -1182,7 +1208,7 @@ - + Whether we relay transactions to this peer. @@ -1192,7 +1218,7 @@ - + IBeamCursor @@ -1208,7 +1234,7 @@ - + High bandwidth BIP152 compact block relay: %1 @@ -1218,7 +1244,7 @@ - + IBeamCursor @@ -1234,14 +1260,14 @@ - + Starting Block - + IBeamCursor @@ -1257,14 +1283,14 @@ - + Synced Headers - + IBeamCursor @@ -1280,14 +1306,14 @@ - + Synced Blocks - + IBeamCursor @@ -1303,14 +1329,14 @@ - + Connection Time - + IBeamCursor @@ -1326,7 +1352,7 @@ - + Elapsed time since a novel block passing initial validity checks was received from this peer. @@ -1336,7 +1362,7 @@ - + IBeamCursor @@ -1352,7 +1378,7 @@ - + Elapsed time since a novel transaction accepted into our mempool was received from this peer. @@ -1362,7 +1388,7 @@ - + IBeamCursor @@ -1378,14 +1404,14 @@ - + Last Send - + IBeamCursor @@ -1401,14 +1427,14 @@ - + Last Receive - + IBeamCursor @@ -1424,14 +1450,14 @@ - + Sent - + IBeamCursor @@ -1447,14 +1473,14 @@ - + Received - + IBeamCursor @@ -1470,14 +1496,14 @@ - + Ping Time - + IBeamCursor @@ -1493,7 +1519,7 @@ - + The duration of a currently outstanding ping. @@ -1503,7 +1529,7 @@ - + IBeamCursor @@ -1519,14 +1545,14 @@ - + Min Ping - + IBeamCursor @@ -1542,14 +1568,14 @@ - + Time Offset - + IBeamCursor @@ -1565,7 +1591,7 @@ - + The mapped Autonomous System used for diversifying peer selection. @@ -1575,7 +1601,7 @@ - + IBeamCursor @@ -1591,7 +1617,7 @@ - + Whether we relay addresses to this peer. @@ -1601,7 +1627,7 @@ - + IBeamCursor @@ -1617,7 +1643,7 @@ - + The total number of addresses received from this peer that were processed (excludes addresses that were dropped due to rate-limiting). @@ -1627,7 +1653,7 @@ - + IBeamCursor @@ -1643,7 +1669,7 @@ - + The total number of addresses received from this peer that were dropped (not processed) due to rate-limiting. @@ -1653,7 +1679,7 @@ - + IBeamCursor @@ -1669,7 +1695,7 @@ - + Qt::Vertical diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index cb4ecfb6fb..27d460f8e1 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -514,8 +515,17 @@ RPCConsole::RPCConsole(interfaces::Node& node, const PlatformStyle *_platformSty /*: Explanatory text for a short-lived outbound peer connection that is used to request addresses from a peer. */ tr("Outbound Address Fetch: short-lived, for soliciting addresses")}; - const QString list{"
  • " + Join(CONNECTION_TYPE_DOC, QString("
  • ")) + "
"}; - ui->peerConnectionTypeLabel->setToolTip(ui->peerConnectionTypeLabel->toolTip().arg(list)); + const QString connection_types_list{"
  • " + Join(CONNECTION_TYPE_DOC, QString("
  • ")) + "
"}; + ui->peerConnectionTypeLabel->setToolTip(ui->peerConnectionTypeLabel->toolTip().arg(connection_types_list)); + const std::vector TRANSPORT_TYPE_DOC{ + //: Explanatory text for "detecting" transport type. + tr("detecting: peer could be v1 or v2"), + //: Explanatory text for v1 transport type. + tr("v1: unencrypted, plaintext transport protocol"), + //: Explanatory text for v2 transport type. + tr("v2: BIP324 encrypted transport protocol")}; + const QString transport_types_list{"
  • " + Join(TRANSPORT_TYPE_DOC, QString("
  • ")) + "
"}; + ui->peerTransportTypeLabel->setToolTip(ui->peerTransportTypeLabel->toolTip().arg(transport_types_list)); const QString hb_list{"
  • \"" + ts.to + "\" – " + tr("we selected the peer for high bandwidth relay") + "
  • \"" + ts.from + "\" – " + tr("the peer selected us for high bandwidth relay") + "
  • \"" @@ -1191,6 +1201,7 @@ void RPCConsole::updateDetailWidget() ui->peerSubversion->setText(QString::fromStdString(stats->nodeStats.cleanSubVer)); } ui->peerConnectionType->setText(GUIUtil::ConnectionTypeToQString(stats->nodeStats.m_conn_type, /*prepend_direction=*/true)); + ui->peerTransportType->setText(QString::fromStdString(TransportTypeAsString(stats->nodeStats.m_transport_type))); ui->peerNetwork->setText(GUIUtil::NetworkToQString(stats->nodeStats.m_network)); if (stats->nodeStats.m_permission_flags == NetPermissionFlags::None) { ui->peerPermissions->setText(ts.na); -- cgit v1.2.3