Merge bitcoin/bitcoin#21506: p2p, refactor: make NetPermissionFlags an enum class
7075f604e8scripted-diff: update noban documentation in net_processing.cpp (Jon Atack)a95540cf43scripted-diff: rename NetPermissionFlags enumerators (Jon Atack)810d0929c1p2p, refactor: make NetPermissionFlags a uint32 enum class (Jon Atack)7b55a94497p2p: NetPermissions::HasFlag() pass flags param by value (Jon Atack)91f6e6e6d1scripted-diff: add NetPermissionFlags scopes where not already present (Jon Atack) Pull request description: While reviewing #20196, I noticed the `NetPermissionFlags` enums are frequently called as if they were scoped, yet are still global. This patch upgrades `NetPermissionFlags` to a scoped class enum and updates the enumerator naming, similarly to #19771. See https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#enum-enumerations for more info. This change would eliminate the class of bugs like https://github.com/bitcoin/bitcoin/pull/20196#discussion_r610770148 and #21644, as only defined operations on the flags would compile. ACKs for top commit: laanwj: Code review ACK7075f604e8vasild: ACK7075f604e8Tree-SHA512: 7fcea66ee499f059efc78c934b5f729b3c8573fe304dee2c27c837c2f662b89324790568246d75b2a574cf9f059b42d3551d928996862f4358055eb43521e6f4
This commit is contained in:
9 files changed
+126
-118
No files matched your search
@@ -1062,7 +1062,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->peerNetwork->setText(GUIUtil::NetworkToQString(stats->nodeStats.m_network));
|
||||
if (stats->nodeStats.m_permissionFlags == PF_NONE) {
|
||||
if (stats->nodeStats.m_permissionFlags == NetPermissionFlags::None) {
|
||||
ui->peerPermissions->setText(ts.na);
|
||||
} else {
|
||||
QStringList permissions;
|
||||
|
||||
Reference in new issue
Block a user