aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authorAnthony Towns <aj@erisian.com.au>2022-03-05 04:44:58 +1000
committerAnthony Towns <aj@erisian.com.au>2022-08-29 22:50:54 +1000
commit9816dc96b77fd9780bb97891cd45a1b9798db8f5 (patch)
tree85bacbd46a9e0fa8c9d9a9717ea8a90507e2c450 /src/net.h
parentef26f2f421071986a3878a1a94b0149ae8e16fcd (diff)
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...
Diffstat (limited to 'src/net.h')
-rw-r--r--src/net.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/net.h b/src/net.h
index d062b8a9ff..abdfef85f8 100644
--- a/src/net.h
+++ b/src/net.h
@@ -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);
}