diff options
author | MarcoFalke <falke.marco@gmail.com> | 2020-07-16 08:11:10 +0200 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2020-07-16 08:11:36 +0200 |
commit | 9a714c51dc79993506718617e383294cf6bff0b4 (patch) | |
tree | 0d1e3d98fbe67b85a4b763631363e337220c9b7f /src | |
parent | affed844babde7ea3647178f9e8c6088de1bb7a2 (diff) | |
parent | 784ef8be41c7e5130a6b063b359031ee1ce75aff (diff) |
Merge bitcoin-core/gui#34: Show permissions instead of whitelisted
784ef8be41c7e5130a6b063b359031ee1ce75aff gui: Show permissions instead of whitelisted (Wladimir J. van der Laan)
Pull request description:
Show detailed permissions instead of legacy "whitelisted" flag in the peer list details.
These are formatted with `&` in between just like services flags. It reuses the "N/A" translation message if there are no special permissions.
This removes the one-but-last use of `legacyWhitelisted`.
Top commit has no ACKs.
Tree-SHA512: 11982da4b9d408c74bc56bb3c540c0eb22506be6353aa4d4d6c64461d140f0587be194e2daad1612fddaa2618025a856b33928ad89041558f418f721f6abd407
Diffstat (limited to 'src')
-rw-r--r-- | src/qt/forms/debugwindow.ui | 4 | ||||
-rw-r--r-- | src/qt/rpcconsole.cpp | 10 |
2 files changed, 11 insertions, 3 deletions
diff --git a/src/qt/forms/debugwindow.ui b/src/qt/forms/debugwindow.ui index 4747dd6d26..93840b4169 100644 --- a/src/qt/forms/debugwindow.ui +++ b/src/qt/forms/debugwindow.ui @@ -1082,12 +1082,12 @@ <item row="0" column="0"> <widget class="QLabel" name="label_30"> <property name="text"> - <string>Whitelisted</string> + <string>Permissions</string> </property> </widget> </item> <item row="0" column="1"> - <widget class="QLabel" name="peerWhitelisted"> + <widget class="QLabel" name="peerPermissions"> <property name="cursor"> <cursorShape>IBeamCursor</cursorShape> </property> diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index 694e1c2eae..29fd720244 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -1120,7 +1120,15 @@ void RPCConsole::updateNodeDetail(const CNodeCombinedStats *stats) ui->peerSubversion->setText(QString::fromStdString(stats->nodeStats.cleanSubVer)); ui->peerDirection->setText(stats->nodeStats.fInbound ? tr("Inbound") : tr("Outbound")); ui->peerHeight->setText(QString::number(stats->nodeStats.nStartingHeight)); - ui->peerWhitelisted->setText(stats->nodeStats.m_legacyWhitelisted ? tr("Yes") : tr("No")); + if (stats->nodeStats.m_permissionFlags == PF_NONE) { + ui->peerPermissions->setText(tr("N/A")); + } else { + QStringList permissions; + for (const auto& permission : NetPermissions::ToStrings(stats->nodeStats.m_permissionFlags)) { + permissions.append(QString::fromStdString(permission)); + } + ui->peerPermissions->setText(permissions.join(" & ")); + } 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 |