adds a check whether the socket is open before sending a message

This commit is contained in:
Vito
2025-08-12 19:16:12 +02:00
parent 076371746b
commit 068bcd0399

View File

@@ -240,9 +240,13 @@ PeerImp::send(std::shared_ptr<Message> const& m)
{
if (!strand_.running_in_this_thread())
return post(strand_, std::bind(&PeerImp::send, shared_from_this(), m));
if (gracefulClose_)
return;
if (!socket_.is_open())
return;
auto validator = m->getValidatorKey();
if (validator && !squelch_.expireSquelch(*validator))
{