diff --git a/nano/node/websocket.cpp b/nano/node/websocket.cpp index d893defb2f..0d65a61d4f 100644 --- a/nano/node/websocket.cpp +++ b/nano/node/websocket.cpp @@ -557,6 +557,10 @@ socket (io_ctx_a) { try { + for (std::atomic & item : topic_subscriber_count) + { + item = std::size_t (0); + } acceptor.open (endpoint_a.protocol ()); acceptor.set_option (boost::asio::socket_base::reuse_address (true)); acceptor.bind (endpoint_a); diff --git a/nano/node/websocket.hpp b/nano/node/websocket.hpp index 6ed16ea418..44a9debc8e 100644 --- a/nano/node/websocket.hpp +++ b/nano/node/websocket.hpp @@ -336,7 +336,7 @@ namespace websocket socket_type socket; std::mutex sessions_mutex; std::vector> sessions; - std::array, number_topics> topic_subscriber_count{}; + std::array, number_topics> topic_subscriber_count; std::atomic stopped{ false }; }; }