diff --git a/pkg/network/message.go b/pkg/network/message.go index 187c7c9d9..b66aeaf78 100644 --- a/pkg/network/message.go +++ b/pkg/network/message.go @@ -184,6 +184,9 @@ func (m *Message) decodePayload(br *io.BinReader) error { p = &payload.AddressList{} case CMDBlock: p = &core.Block{} + case CMDConsensus: + // Stubbed out for now, see #431. + return nil case CMDGetBlocks: fallthrough case CMDGetHeaders: diff --git a/pkg/network/server.go b/pkg/network/server.go index 039c8a01d..7f04e9d9a 100644 --- a/pkg/network/server.go +++ b/pkg/network/server.go @@ -252,9 +252,6 @@ func (s *Server) handleVersionCmd(p Peer, version *payload.Version) error { if s.id == version.Nonce { return errIdenticalID } - if p.NetAddr().Port != int(version.Port) { - 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)) } diff --git a/pkg/network/server_test.go b/pkg/network/server_test.go index 7d96b7989..b24205460 100644 --- a/pkg/network/server_test.go +++ b/pkg/network/server_test.go @@ -67,15 +67,9 @@ func TestServerNotSendsVerack(t *testing.T) { p.netaddr = *na s.register <- p - // Port should mismatch - version := payload.NewVersion(1337, 2000, "/NEO-GO/", 0, true) - err := s.handleVersionCmd(p, version) - assert.NotNil(t, err) - assert.Contains(t, err.Error(), "port mismatch") - // identical id's - version = payload.NewVersion(1, 3000, "/NEO-GO/", 0, true) - err = s.handleVersionCmd(p, version) + version := payload.NewVersion(1, 3000, "/NEO-GO/", 0, true) + err := s.handleVersionCmd(p, version) assert.NotNil(t, err) assert.Equal(t, errIdenticalID, err) }