From: Alistair Buxton Date: Sun, 18 Mar 2012 03:03:24 +0000 (+0000) Subject: When disconnecting a node, clear the received buffer so that we do X-Git-Tag: v0.4.0-unstable~129^2~1^2^2~2^2^2~42 X-Git-Url: https://git.novaco.in/?p=novacoin.git;a=commitdiff_plain;h=04dc79f1cc19b48531cc9a16ca502eac34d7e95b When disconnecting a node, clear the received buffer so that we do not process any already received messages. The primary reason to do this is if a node spams hundreds of messages and we ban them, we don't want to continue processing the rest of it. --- diff --git a/src/net.cpp b/src/net.cpp index a8d3d0b..763e160 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -716,6 +716,7 @@ void CNode::CloseSocketDisconnect() printf("disconnecting node %s\n", addr.ToString().c_str()); closesocket(hSocket); hSocket = INVALID_SOCKET; + vRecv.clear(); } }