File tree 1 file changed +1
-16
lines changed
1 file changed +1
-16
lines changed Original file line number Diff line number Diff line change @@ -151,22 +151,7 @@ func (bsnet *impl) ConnectTo(ctx context.Context, p peer.ID) error {
151
151
152
152
// FindProvidersAsync returns a channel of providers for the given key.
153
153
func (bsnet * impl ) FindProvidersAsync (ctx context.Context , k cid.Cid , max int ) <- chan peer.ID {
154
-
155
- // Since routing queries are expensive, give bitswap the peers to which we
156
- // have open connections. Note that this may cause issues if bitswap starts
157
- // precisely tracking which peers provide certain keys. This optimization
158
- // would be misleading. In the long run, this may not be the most
159
- // appropriate place for this optimization, but it won't cause any harm in
160
- // the short term.
161
- connectedPeers := bsnet .host .Network ().Peers ()
162
- out := make (chan peer.ID , len (connectedPeers )) // just enough buffer for these connectedPeers
163
- for _ , id := range connectedPeers {
164
- if id == bsnet .host .ID () {
165
- continue // ignore self as provider
166
- }
167
- out <- id
168
- }
169
-
154
+ out := make (chan peer.ID , max )
170
155
go func () {
171
156
defer close (out )
172
157
providers := bsnet .routing .FindProvidersAsync (ctx , k , max )
You can’t perform that action at this time.
0 commit comments