diff --git a/exchange/bitswap/bitswap.go b/exchange/bitswap/bitswap.go index 3ccab5d97..369fcee75 100644 --- a/exchange/bitswap/bitswap.go +++ b/exchange/bitswap/bitswap.go @@ -32,11 +32,9 @@ func NetMessageSession(ctx context.Context, p peer.Peer, notif := notifications.New() go func() { - for { - select { - case <-ctx.Done(): - notif.Shutdown() - } + select { + case <-ctx.Done(): + notif.Shutdown() } }()