Skip to content

Commit 784ef8b

Browse files
committed
gui: Show permissions instead of whitelisted
Show detailed permissions instead of legacy "whitelisted" flag. These are formatted with `&` in between just like services flags. It reuses the "N/A" translation message if not. This removes the one-but-last use of `legacyWhitelisted`.
1 parent 804ca26 commit 784ef8b

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)