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.
This commit is contained in:
Alistair Buxton
2012-03-22 16:19:26 -04:00
committed by Luke Dashjr
parent b6751ed1b2
commit 04dc79f1cc
+1
View File
@@ -716,6 +716,7 @@ void CNode::CloseSocketDisconnect()
printf("disconnecting node %s\n", addr.ToString().c_str());
closesocket(hSocket);
hSocket = INVALID_SOCKET;
vRecv.clear();
}
}