mirror of
https://github.com/twisterarmy/twister-core.git
synced 2025-01-11 07:17:53 +00:00
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:
parent
840f69c582
commit
bb13d056ea
@ -559,6 +559,7 @@ void CNode::CloseSocketDisconnect()
|
|||||||
printf("disconnecting node %s\n", addr.ToString().c_str());
|
printf("disconnecting node %s\n", addr.ToString().c_str());
|
||||||
closesocket(hSocket);
|
closesocket(hSocket);
|
||||||
hSocket = INVALID_SOCKET;
|
hSocket = INVALID_SOCKET;
|
||||||
|
vRecv.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user