diff --git a/p2p/protocol/identify/id.go b/p2p/protocol/identify/id.go index c548fd32729cb5b073bce3d98db609b65d015efe..fb949851e0dca469455723005e60e999aacc7c01 100644 --- a/p2p/protocol/identify/id.go +++ b/p2p/protocol/identify/id.go @@ -92,13 +92,13 @@ func (ids *IDService) IdentifyConn(c inet.Conn) { c.Close() return } - defer inet.FullClose(s) s.SetProtocol(ID) // ok give the response to our handler. if err := msmux.SelectProtoOrFail(ID, s); err != nil { log.Event(context.TODO(), "IdentifyOpenFailed", c.RemotePeer(), logging.Metadata{"error": err}) + s.Reset() return } @@ -111,8 +111,8 @@ func (ids *IDService) IdentifyConn(c inet.Conn) { if !found { log.Errorf("IdentifyConn failed to find channel (programmer error) for %s", c) - return } + inet.FullClose(s) } func (ids *IDService) requestHandler(s inet.Stream) {