We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
findProvs()
1 parent 48aceb1 commit 6844dfbCopy full SHA for 6844dfb
src/core/components/dht.js
@@ -56,12 +56,19 @@ module.exports = (self) => {
56
* @param {function(Error, Array<PeerInfo>)} [callback]
57
* @returns {Promise<PeerInfo>|void}
58
*/
59
- findprovs: promisify((key, callback) => {
+ findprovs: promisify((key, opts, callback) => {
60
if (typeof key === 'string') {
61
key = new CID(key)
62
}
63
64
- self._libp2pNode.contentRouting.findProviders(key, callback)
+ if (typeof opts === 'function') {
65
+ callback = opts
66
+ opts = {}
67
+ }
68
+
69
+ opts = opts || {}
70
71
+ self._libp2pNode.contentRouting.findProviders(key, opts.timeout || null, callback)
72
}),
73
74
/**
0 commit comments