libp2p-kad-dht
Advanced tools
Comparing version 0.14.6 to 0.14.7
@@ -0,1 +1,11 @@ | ||
<a name="0.14.7"></a> | ||
## [0.14.7](https://github.com/libp2p/js-libp2p-kad-dht/compare/v0.14.6...v0.14.7) (2019-03-04) | ||
### Bug Fixes | ||
* put query for closest peers ([#85](https://github.com/libp2p/js-libp2p-kad-dht/issues/85)) ([84a40cd](https://github.com/libp2p/js-libp2p-kad-dht/commit/84a40cd)) | ||
<a name="0.14.6"></a> | ||
@@ -2,0 +12,0 @@ ## [0.14.6](https://github.com/libp2p/js-libp2p-kad-dht/compare/v0.14.5...v0.14.6) (2019-02-25) |
{ | ||
"name": "libp2p-kad-dht", | ||
"version": "0.14.6", | ||
"version": "0.14.7", | ||
"description": "JavaScript implementation of the Kad-DHT for libp2p", | ||
@@ -5,0 +5,0 @@ "leadMaintainer": "Vasco Santos <vasco.santos@moxy.studio>", |
@@ -220,3 +220,3 @@ 'use strict' | ||
(cb) => this._putLocal(key, rec, cb), | ||
(cb) => this.getClosestPeers(key, cb), | ||
(cb) => this.getClosestPeers(key, { shallow: true }, cb), | ||
(peers, cb) => { | ||
@@ -391,7 +391,17 @@ // Ensure we have a default `minPeers` | ||
* @param {Buffer} key | ||
* @param {Object} options | ||
* @param {boolean} options.shallow shallow query | ||
* @param {function(Error, Array<PeerId>)} callback | ||
* @returns {void} | ||
*/ | ||
getClosestPeers (key, callback) { | ||
getClosestPeers (key, options, callback) { | ||
this._log('getClosestPeers to %b', key) | ||
if (typeof options === 'function') { | ||
callback = options | ||
options = { | ||
shallow: false | ||
} | ||
} | ||
utils.convertBuffer(key, (err, id) => { | ||
@@ -413,3 +423,4 @@ if (err) { | ||
cb(null, { | ||
closerPeers: closer | ||
closerPeers: closer, | ||
success: options.shallow ? true : undefined | ||
}) | ||
@@ -416,0 +427,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
181595
5462