diff --git a/fullrt/dht.go b/fullrt/dht.go index 60842cf3..99d1c3eb 100644 --- a/fullrt/dht.go +++ b/fullrt/dht.go @@ -1238,11 +1238,7 @@ func (dht *FullRT) FindProvidersAsync(ctx context.Context, key cid.Cid, count in return peerOut } - chSize := count - if count == 0 { - chSize = 1 - } - peerOut := make(chan peer.AddrInfo, chSize) + peerOut := make(chan peer.AddrInfo) keyMH := key.Hash() diff --git a/routing.go b/routing.go index 1a68c6eb..b0778b9d 100644 --- a/routing.go +++ b/routing.go @@ -503,11 +503,7 @@ func (dht *IpfsDHT) FindProvidersAsync(ctx context.Context, key cid.Cid, count i return peerOut } - chSize := count - if count == 0 { - chSize = 1 - } - peerOut := make(chan peer.AddrInfo, chSize) + peerOut := make(chan peer.AddrInfo) keyMH := key.Hash()