mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-03 11:41:48 +00:00
network: be more specific on port mismatch error
This commit is contained in:
parent
773ccc2b92
commit
b2530a4c93
2 changed files with 2 additions and 3 deletions
|
@ -23,7 +23,6 @@ const (
|
|||
)
|
||||
|
||||
var (
|
||||
errPortMismatch = errors.New("port mismatch")
|
||||
errIdenticalID = errors.New("identical node id")
|
||||
errInvalidHandshake = errors.New("invalid handshake")
|
||||
errInvalidNetwork = errors.New("invalid network")
|
||||
|
@ -248,7 +247,7 @@ func (s *Server) handleVersionCmd(p Peer, version *payload.Version) error {
|
|||
return errIdenticalID
|
||||
}
|
||||
if p.NetAddr().Port != int(version.Port) {
|
||||
return errPortMismatch
|
||||
return fmt.Errorf("port mismatch: connected to %d and peer sends %d", p.NetAddr().Port, version.Port)
|
||||
}
|
||||
return p.SendVersionAck(NewMessage(s.Net, CMDVerack, nil))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue