From 4a9f382f01dd4d0df8d539bf2e0a306b22d7bf29 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Thu, 16 Jul 2020 08:11:10 +0200 Subject: [PATCH] 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 --- src/qt/forms/debugwindow.ui | 4 ++-- 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 ba7a97036b..2f20c49092 100644 --- a/src/qt/forms/debugwindow.ui +++ b/src/qt/forms/debugwindow.ui @@ -1005,12 +1005,12 @@ - Whitelisted + Permissions - + IBeamCursor diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index 6853acc673..9508c25e47 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -1257,7 +1257,15 @@ void RPCConsole::updateNodeDetail(const CNodeCombinedStats *stats) : tr("Outbound block-relay")); ui->peerHeight->setText(QString::number(stats->nodeStats.nStartingHeight)); ui->peerNetwork->setText(GUIUtil::NetworkToQString(stats->nodeStats.m_network)); - 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")); auto dmn = clientModel->getMasternodeList().first.GetMNByService(stats->nodeStats.addr); if (dmn == nullptr) {