mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-11-02 13:37:24 +00:00
Peer: Receiving main protocol messages before version handshake completed is a protocol violation.
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user