From bb13d056ea332030a3b960bf2756a36de77e05b8 Mon Sep 17 00:00:00 2001 From: Alistair Buxton Date: Sun, 18 Mar 2012 03:03:24 +0000 Subject: [PATCH] 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. --- src/net.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/net.cpp b/src/net.cpp index b22300e8..94ef7e7b 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -559,6 +559,7 @@ void CNode::CloseSocketDisconnect() printf("disconnecting node %s\n", addr.ToString().c_str()); closesocket(hSocket); hSocket = INVALID_SOCKET; + vRecv.clear(); } }