Skip to content

Commit

Permalink
FIX
Browse files Browse the repository at this point in the history
  • Loading branch information
pwojcikdev committed Mar 16, 2024
1 parent 195d10e commit 5e0f811
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions nano/node/transport/tcp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,19 +151,22 @@ void nano::transport::tcp_channels::stop ()
message_manager.stop ();

// Close all TCP sockets
for (auto const & channel : channels)
{
if (channel.socket)
{
channel.socket->close ();
}
// Remove response server
if (channel.response_server)
nano::lock_guard<nano::mutex> lock{ mutex };
for (auto const & channel : channels)
{
channel.response_server->stop ();
if (channel.socket)
{
channel.socket->close ();
}
// Remove response server
if (channel.response_server)
{
channel.response_server->stop ();
}
}
channels.clear ();
}
channels.clear ();
}

bool nano::transport::tcp_channels::insert (std::shared_ptr<nano::transport::channel_tcp> const & channel_a, std::shared_ptr<nano::transport::socket> const & socket_a, std::shared_ptr<nano::transport::tcp_server> const & server_a)
Expand Down

0 comments on commit 5e0f811

Please sign in to comment.