Skip to content

Commit 6042587

Browse files
committed
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.
1 parent f6315e0 commit 6042587

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

src/net.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -437,11 +437,6 @@ void CNode::CloseSocketDisconnect()
437437
LogPrint("net", "disconnecting peer=%d\n", id);
438438
CloseSocket(hSocket);
439439
}
440-
441-
// in case this fails, we'll empty the recv buffer when the CNode is deleted
442-
TRY_LOCK(cs_vRecvMsg, lockRecv);
443-
if (lockRecv)
444-
vRecvMsg.clear();
445440
}
446441

447442
void CConnman::ClearBanned()

0 commit comments

Comments
 (0)