From 5841dfef0ffd20caf0a6c191be3bff6eb5501ffe Mon Sep 17 00:00:00 2001 From: kumavis Date: Sun, 19 May 2019 10:54:37 +0800 Subject: [PATCH] fix: in _findNProviders correctly calculate pathSize --- src/private.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/private.js b/src/private.js index 05da806b..17ad852e 100644 --- a/src/private.js +++ b/src/private.js @@ -538,7 +538,7 @@ module.exports = (dht) => ({ const paths = [] const query = new Query(dht, key.buffer, (pathIndex, numPaths) => { // This function body runs once per disjoint path - const pathSize = utils.pathSize(out.length - n, numPaths) + const pathSize = utils.pathSize(n - out.length, numPaths) const pathProviders = new LimitedPeerList(pathSize) paths.push(pathProviders)