|
|
@ -257,7 +257,7 @@ public class EthProtocolManager implements ProtocolManager, MinedBlockObserver { |
|
|
|
} else if (!ethPeer.statusHasBeenReceived()) { |
|
|
|
} else if (!ethPeer.statusHasBeenReceived()) { |
|
|
|
// Peers are required to send status messages before any other message type
|
|
|
|
// Peers are required to send status messages before any other message type
|
|
|
|
LOG.debug( |
|
|
|
LOG.debug( |
|
|
|
"{} requires a Status ({}) message to be sent first. Instead, received message {}. Disconnecting from {}.", |
|
|
|
"{} requires a Status ({}) message to be sent first. Instead, received message {} (BREACH_OF_PROTOCOL). Disconnecting from {}.", |
|
|
|
this.getClass().getSimpleName(), |
|
|
|
this.getClass().getSimpleName(), |
|
|
|
EthPV62.STATUS, |
|
|
|
EthPV62.STATUS, |
|
|
|
code, |
|
|
|
code, |
|
|
@ -277,7 +277,9 @@ public class EthProtocolManager implements ProtocolManager, MinedBlockObserver { |
|
|
|
final EthMessage ethMessage = new EthMessage(ethPeer, messageData); |
|
|
|
final EthMessage ethMessage = new EthMessage(ethPeer, messageData); |
|
|
|
|
|
|
|
|
|
|
|
if (!ethPeer.validateReceivedMessage(ethMessage, getSupportedProtocol())) { |
|
|
|
if (!ethPeer.validateReceivedMessage(ethMessage, getSupportedProtocol())) { |
|
|
|
LOG.debug("Unsolicited message received, disconnecting from EthPeer: {}", ethPeer); |
|
|
|
LOG.debug( |
|
|
|
|
|
|
|
"Unsolicited message received (BREACH_OF_PROTOCOL), disconnecting from EthPeer: {}", |
|
|
|
|
|
|
|
ethPeer); |
|
|
|
ethPeer.disconnect(DisconnectReason.BREACH_OF_PROTOCOL); |
|
|
|
ethPeer.disconnect(DisconnectReason.BREACH_OF_PROTOCOL); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
@ -308,7 +310,10 @@ public class EthProtocolManager implements ProtocolManager, MinedBlockObserver { |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (final RLPException e) { |
|
|
|
} catch (final RLPException e) { |
|
|
|
LOG.debug( |
|
|
|
LOG.debug( |
|
|
|
"Received malformed message {} , disconnecting: {}", messageData.getData(), ethPeer, e); |
|
|
|
"Received malformed message {} (BREACH_OF_PROTOCOL), disconnecting: {}", |
|
|
|
|
|
|
|
messageData.getData(), |
|
|
|
|
|
|
|
ethPeer, |
|
|
|
|
|
|
|
e); |
|
|
|
|
|
|
|
|
|
|
|
ethPeer.disconnect(DisconnectMessage.DisconnectReason.BREACH_OF_PROTOCOL); |
|
|
|
ethPeer.disconnect(DisconnectMessage.DisconnectReason.BREACH_OF_PROTOCOL); |
|
|
|
} |
|
|
|
} |
|
|
|