diff options
author | Anthony Towns <aj@erisian.com.au> | 2022-05-20 05:37:54 +1000 |
---|---|---|
committer | Anthony Towns <aj@erisian.com.au> | 2022-08-29 22:50:54 +1000 |
commit | ef26f2f421071986a3878a1a94b0149ae8e16fcd (patch) | |
tree | a156568bc6c1d947069a12bc743d7054347e9be2 /src/net.h | |
parent | bbec32c9ad2fe213314db9d39aa1eacff2e0bc23 (diff) |
net: mark CNode unique_ptr members as const
Dereferencing a unique_ptr is not necessarily thread safe. The reason
these are safe is because their values are set at construction and do
not change later; so mark them as const and set them via the initializer
list to guarantee that.
Diffstat (limited to 'src/net.h')
-rw-r--r-- | src/net.h | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -341,8 +341,8 @@ class CNode friend struct ConnmanTestMsg; public: - std::unique_ptr<TransportDeserializer> m_deserializer; - std::unique_ptr<const TransportSerializer> m_serializer; + 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}; |