diff --git a/p2p/host/basic/basic_host.go b/p2p/host/basic/basic_host.go index 327de871d5..71e2e5491a 100644 --- a/p2p/host/basic/basic_host.go +++ b/p2p/host/basic/basic_host.go @@ -623,6 +623,7 @@ func (h *BasicHost) NewStream(ctx context.Context, p peer.ID, pids ...protocol.I select { case <-h.ids.IdentifyWait(s.Conn()): case <-ctx.Done(): + _ = s.Reset() return nil, ctx.Err() }