mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-02 08:59:08 +02:00
net: note CNode members that are treated as const
m_permissionFlags and m_prefer_evict are treated as const -- they're only set immediately after construction before any other thread has access to the object, and not changed again afterwards. As such they don't need to be marked atomic or guarded by a mutex; though it would probably be better to actually mark them as const...
This commit is contained in:
parent
ef26f2f421
commit
9816dc96b7
@ -344,7 +344,7 @@ public:
|
||||
const std::unique_ptr<TransportDeserializer> m_deserializer; // Used only by SocketHandler thread
|
||||
const std::unique_ptr<const TransportSerializer> m_serializer;
|
||||
|
||||
NetPermissionFlags m_permissionFlags{NetPermissionFlags::None};
|
||||
NetPermissionFlags m_permissionFlags{NetPermissionFlags::None}; // treated as const outside of fuzz tester
|
||||
|
||||
/**
|
||||
* Socket used for communication with the node.
|
||||
@ -393,7 +393,7 @@ public:
|
||||
* from the wire. This cleaned string can safely be logged or displayed.
|
||||
*/
|
||||
std::string cleanSubVer GUARDED_BY(m_subver_mutex){};
|
||||
bool m_prefer_evict{false}; // This peer is preferred for eviction.
|
||||
bool m_prefer_evict{false}; // This peer is preferred for eviction. (treated as const)
|
||||
bool HasPermission(NetPermissionFlags permission) const {
|
||||
return NetPermissions::HasFlag(m_permissionFlags, permission);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user