Browse Source

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.
0.14
Cory Fields 8 years ago
parent
commit
60425870d7
  1. 5
      src/net.cpp

5
src/net.cpp

@ -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…
Cancel
Save