diff --git a/nano/node/transport/tcp_socket.cpp b/nano/node/transport/tcp_socket.cpp index e85ee7a894..3d5ff9c512 100644 --- a/nano/node/transport/tcp_socket.cpp +++ b/nano/node/transport/tcp_socket.cpp @@ -412,7 +412,7 @@ void nano::transport::tcp_socket::operator() (nano::object_stream & obs) const { obs.write ("remote_endpoint", remote_endpoint ()); obs.write ("local_endpoint", local_endpoint ()); - obs.write ("type", type_m); + obs.write ("type", type_m.load ()); obs.write ("endpoint_type", endpoint_type_m); } diff --git a/nano/node/transport/tcp_socket.hpp b/nano/node/transport/tcp_socket.hpp index 5eadaa2e36..8180fb6941 100644 --- a/nano/node/transport/tcp_socket.hpp +++ b/nano/node/transport/tcp_socket.hpp @@ -115,9 +115,9 @@ class tcp_socket final : public std::enable_shared_from_this { return type_m; }; - void type_set (nano::transport::socket_type type_a) + void type_set (nano::transport::socket_type type) { - type_m = type_a; + type_m = type; } nano::transport::socket_endpoint endpoint_type () const { @@ -195,8 +195,8 @@ class tcp_socket final : public std::enable_shared_from_this void read_impl (std::shared_ptr> const & data_a, std::size_t size_a, std::function callback_a); private: - nano::transport::socket_type type_m{ socket_type::undefined }; - nano::transport::socket_endpoint endpoint_type_m; + socket_endpoint const endpoint_type_m; + std::atomic type_m{ socket_type::undefined }; public: std::size_t const max_queue_size;