Cory Fields cbfc5a6728 net: require a verack before responding to anything else
7a8c251901 made this logic hard to follow. After that change, messages would
not be sent to a peer via SendMessages() before the handshake was complete, but
messages could still be sent as a response to an incoming message.

For example, if a peer had not yet sent a verack, we wouldn't notify it about
new blocks, but we would respond to a PING with a PONG.

This change makes the behavior straightforward: until we've received a verack,
never send any message other than version/verack/reject.

The behavior until a VERACK is received has always been undefined, this change
just tightens our policy.

This also makes testing much easier, because we can now connect but not send
version/verack, and anything sent to us is an error.
2017-02-13 18:55:35 -05:00
..
2017-01-27 21:22:35 +01:00
2016-12-01 16:14:45 -08:00
2017-02-06 14:20:05 +01:00
2017-01-27 21:22:35 +01:00
2016-12-12 11:08:47 -08:00
2017-01-27 21:22:35 +01:00
2017-01-04 11:56:17 -08:00
2017-01-27 21:22:35 +01:00
2017-01-14 21:45:32 +01:00
2017-01-27 21:22:35 +01:00
2017-01-04 13:24:19 -05:00
2017-01-27 21:22:35 +01:00
2017-01-27 21:22:35 +01:00
2017-01-27 21:22:35 +01:00
2017-01-27 21:22:35 +01:00