aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authorW. J. van der Laan <laanwj@protonmail.com>2021-05-19 11:23:38 +0200
committerW. J. van der Laan <laanwj@protonmail.com>2021-05-19 11:57:24 +0200
commit4da26fb85d6d6d205a2794ccb98beee1302b4a25 (patch)
tree8b8601b947853dc1313c16f78eca57eaefd6542c /src/net.h
parent1ed859e90e18384376e3a1ff0cb76f3e9ab11c2d (diff)
parent7075f604e8d0b21b2255fa57e20cd365dc10a288 (diff)
downloadbitcoin-4da26fb85d6d6d205a2794ccb98beee1302b4a25.tar.xz
Merge bitcoin/bitcoin#21506: p2p, refactor: make NetPermissionFlags an enum class
7075f604e8d0b21b2255fa57e20cd365dc10a288 scripted-diff: update noban documentation in net_processing.cpp (Jon Atack) a95540cf435029f06e56749802d71315ca76b0dd scripted-diff: rename NetPermissionFlags enumerators (Jon Atack) 810d0929c1626bba141af3f779a3c9cd6ece7e75 p2p, refactor: make NetPermissionFlags a uint32 enum class (Jon Atack) 7b55a9449778c5ac89799ce4c607c8c8d797ddfb p2p: NetPermissions::HasFlag() pass flags param by value (Jon Atack) 91f6e6e6d1720e1154ad3f70a5098e9028efa84a scripted-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 ACK 7075f604e8d0b21b2255fa57e20cd365dc10a288 vasild: ACK 7075f604e8d0b21b2255fa57e20cd365dc10a288 Tree-SHA512: 7fcea66ee499f059efc78c934b5f729b3c8573fe304dee2c27c837c2f662b89324790568246d75b2a574cf9f059b42d3551d928996862f4358055eb43521e6f4
Diffstat (limited to 'src/net.h')
-rw-r--r--src/net.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/net.h b/src/net.h
index 6b9a7ef136..65b262e573 100644
--- a/src/net.h
+++ b/src/net.h
@@ -402,7 +402,7 @@ public:
std::unique_ptr<TransportDeserializer> m_deserializer;
std::unique_ptr<TransportSerializer> m_serializer;
- NetPermissionFlags m_permissionFlags{PF_NONE};
+ NetPermissionFlags m_permissionFlags{NetPermissionFlags::None};
std::atomic<ServiceFlags> nServices{NODE_NONE};
SOCKET hSocket GUARDED_BY(cs_hSocket);
/** Total size of all vSendMsg entries */