Skip to content

Commit 9a714c5

Browse files
author
MarcoFalke
committed
Merge bitcoin-core#34: Show permissions instead of whitelisted
784ef8b 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
2 parents affed84 + 784ef8b commit 9a714c5

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/qt/forms/debugwindow.ui

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,12 +1082,12 @@
10821082
<item row="0" column="0">
10831083
<widget class="QLabel" name="label_30">
10841084
<property name="text">
1085-
<string>Whitelisted</string>
1085+
<string>Permissions</string>
10861086
</property>
10871087
</widget>
10881088
</item>
10891089
<item row="0" column="1">
1090-
<widget class="QLabel" name="peerWhitelisted">
1090+
<widget class="QLabel" name="peerPermissions">
10911091
<property name="cursor">
10921092
<cursorShape>IBeamCursor</cursorShape>
10931093
</property>

src/qt/rpcconsole.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1120,7 +1120,15 @@ void RPCConsole::updateNodeDetail(const CNodeCombinedStats *stats)
11201120
ui->peerSubversion->setText(QString::fromStdString(stats->nodeStats.cleanSubVer));
11211121
ui->peerDirection->setText(stats->nodeStats.fInbound ? tr("Inbound") : tr("Outbound"));
11221122
ui->peerHeight->setText(QString::number(stats->nodeStats.nStartingHeight));
1123-
ui->peerWhitelisted->setText(stats->nodeStats.m_legacyWhitelisted ? tr("Yes") : tr("No"));
1123+
if (stats->nodeStats.m_permissionFlags == PF_NONE) {
1124+
ui->peerPermissions->setText(tr("N/A"));
1125+
} else {
1126+
QStringList permissions;
1127+
for (const auto& permission : NetPermissions::ToStrings(stats->nodeStats.m_permissionFlags)) {
1128+
permissions.append(QString::fromStdString(permission));
1129+
}
1130+
ui->peerPermissions->setText(permissions.join(" & "));
1131+
}
11241132
ui->peerMappedAS->setText(stats->nodeStats.m_mapped_as != 0 ? QString::number(stats->nodeStats.m_mapped_as) : tr("N/A"));
11251133

11261134
// This check fails for example if the lock was busy and

0 commit comments

Comments
 (0)