From 218e567bf788ecf0dd79e94cb5992b637391c562 Mon Sep 17 00:00:00 2001 From: roks0n Date: Wed, 24 Jul 2019 17:46:05 +0200 Subject: [PATCH] derp --- src/crawler.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/crawler.js b/src/crawler.js index d93eb7d..c37203f 100644 --- a/src/crawler.js +++ b/src/crawler.js @@ -21,6 +21,7 @@ class Crawler { version: 'no-version' } } + this.sampleSize = sampleSize this.peers = new Peers() } @@ -97,7 +98,7 @@ class Crawler { .map(x => ({ x, r: Math.random() })) .sort((a, b) => a.r - b.r) .map(a => a.x) - .slice(0, 10) + .slice(0, this.sampleSize) .filter(a => a.ip !== peer.ip) .map((peer) => { this.samplePeers[peer.ip] = NOT_VISITED