mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-05-14 04:00:41 +02:00
net: wait until the node is destroyed to delete its recv buffer
when vRecvMsg becomes a private buffer, it won't make sense to allow other threads to mess with it anymore.
This commit is contained in:
parent
f6315e07f9
commit
60425870d7
@ -437,11 +437,6 @@ void CNode::CloseSocketDisconnect()
|
|||||||
LogPrint("net", "disconnecting peer=%d\n", id);
|
LogPrint("net", "disconnecting peer=%d\n", id);
|
||||||
CloseSocket(hSocket);
|
CloseSocket(hSocket);
|
||||||
}
|
}
|
||||||
|
|
||||||
// in case this fails, we'll empty the recv buffer when the CNode is deleted
|
|
||||||
TRY_LOCK(cs_vRecvMsg, lockRecv);
|
|
||||||
if (lockRecv)
|
|
||||||
vRecvMsg.clear();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CConnman::ClearBanned()
|
void CConnman::ClearBanned()
|
||||||
|
Loading…
Reference in New Issue
Block a user