net: correctly ban before the handshake is complete
commitc45b9fb54c5ca068a5e276c3bd6ebf4ae720f6f7
authorCory Fields <cory-nospam-@coryfields.com>
Tue, 7 Feb 2017 17:02:02 +0000 (7 12:02 -0500)
committerCory Fields <cory-nospam-@coryfields.com>
Mon, 13 Feb 2017 23:55:34 +0000 (13 18:55 -0500)
tree0bdc565d53b939f0f227b108406c82f034cb5e61
parentd304fef3746039183f51b3ac8f4774dcf3a64f59
net: correctly ban before the handshake is complete

7a8c251901 made a change to avoid getting into SendMessages() until the
version handshake (VERSION + VERACK) is complete. That was done to avoid
leaking out messages to nodes who could connect, but never bothered sending
us their version/verack.

Unfortunately, the ban tally and possible disconnect are done as part of
SendMessages(). So after 7a8c251901, if a peer managed to do something
bannable before completing the handshake (say send 100 non-version messages
before their version), they wouldn't actually end up getting
disconnected/banned. That's fixed here by checking the banscore as part of
ProcessMessages() in addition to SendMessages().
src/net_processing.cpp