Skip to content

Commit 31493dc

Browse files
jacobheunvmx
authored andcommitted
feat: send max providers to findProviders request
1 parent 0e93189 commit 31493dc

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/network.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,10 @@ class Network {
9898
}
9999

100100
findProviders (cid, maxProviders, callback) {
101-
// TODO
102-
// consider if we want to trickleDown maxProviders, currently this is
103-
// not an exposed option:
104-
// https://github.com/libp2p/js-libp2p-kad-dht/blob/master/src/index.js#L416
105-
this.libp2p.contentRouting.findProviders(cid, CONSTANTS.providerRequestTimeout, callback)
101+
this.libp2p.contentRouting.findProviders(cid, {
102+
maxTimeout: CONSTANTS.providerRequestTimeout,
103+
maxNumProviders: maxProviders
104+
}, callback)
106105
}
107106

108107
findAndConnect (cid, callback) {

0 commit comments

Comments
 (0)