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

fix: make findProviders treat timeout the same as findPeer #35

Merged
merged 1 commit into from
Aug 29, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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