Skip to content
This repository has been archived by the owner on Jul 21, 2023. It is now read-only.

Commit

Permalink
fix: make findProviders treat timeout the same as findPeer (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobheun authored and vasco-santos committed Aug 29, 2018
1 parent bb5f9af commit fcdb01d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,15 @@ class KadDHT {
* @returns {void}
*/
findProviders (key, timeout, callback) {
if (typeof timeout === 'function') {
callback = timeout
timeout = null
}

if (timeout == null) {
timeout = c.minute
}

this._log('findProviders %s', key.toBaseEncodedString())
this._findNProviders(key, timeout, c.K, callback)
}
Expand Down

0 comments on commit fcdb01d

Please sign in to comment.