mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-02-24 14:50:57 +01:00
Peer: Receiving main protocol messages before version handshake completed is a protocol violation.
This commit is contained in:
parent
709e6f7562
commit
67e1434b51
1 changed files with 6 additions and 0 deletions
|
@ -459,6 +459,12 @@ public class Peer extends PeerSocketHandler {
|
|||
currentFilteredBlock = null;
|
||||
}
|
||||
|
||||
// No further communication is possible until version handshake is complete.
|
||||
if (!(m instanceof VersionMessage || m instanceof VersionAck
|
||||
|| (versionHandshakeFuture.isDone() && !versionHandshakeFuture.isCancelled())))
|
||||
throw new ProtocolException(
|
||||
"Received " + m.getClass().getSimpleName() + " before version handshake is complete.");
|
||||
|
||||
if (m instanceof Ping) {
|
||||
processPing((Ping) m);
|
||||
} else if (m instanceof Pong) {
|
||||
|
|
Loading…
Add table
Reference in a new issue