fix: add handshake check to unsigned messages as well
This commit is contained in:
parent
47c82c6a03
commit
5a0b742139
|
@ -434,6 +434,11 @@ func (p *P2PServiceDefault) OnNewPeerListen(peer net.Peer, verifyId bool) {
|
||||||
return fmt.Errorf("unknown message type: %d", reader.Kind)
|
return fmt.Errorf("unknown message type: %d", reader.Kind)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if handler.RequiresHandshake() && !peer.IsHandshakeDone() {
|
||||||
|
p.Logger().Debug("Peer is not handshake done, ignoring message", zap.Any("type", types.ProtocolMethodMap[types.ProtocolMethod(reader.Kind)]))
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
data := protocol.IncomingMessageData{
|
data := protocol.IncomingMessageData{
|
||||||
Original: message,
|
Original: message,
|
||||||
Data: reader.Data,
|
Data: reader.Data,
|
||||||
|
|
Loading…
Reference in New Issue