aboutsummaryrefslogtreecommitdiff
path: root/src/net.cpp
diff options
context:
space:
mode:
authorAlistair Buxton <a.j.buxton@gmail.com>2012-03-18 03:03:24 +0000
committerLuke Dashjr <luke-jr+git@utopios.org>2012-03-22 16:19:26 -0400
commit04dc79f1cc19b48531cc9a16ca502eac34d7e95b (patch)
treeb70795f5074877257ec7c1e901970a945b913bfe /src/net.cpp
parentb6751ed1b2a71e07cd3a8af4f02ce64fec39fe88 (diff)
downloadbitcoin-04dc79f1cc19b48531cc9a16ca502eac34d7e95b.tar.xz
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.
Diffstat (limited to 'src/net.cpp')
-rw-r--r--src/net.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/net.cpp b/src/net.cpp
index a8d3d0b171..763e160edd 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();
}
}