From 127fea663f9abadfeba5ae5adf7631995c4f9b30 Mon Sep 17 00:00:00 2001 From: Javed Khan Date: Thu, 31 Jan 2019 20:27:47 +0530 Subject: [PATCH 1/2] pool: disable discover with only --- lib/net/pool.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/net/pool.js b/lib/net/pool.js index cc3854c4..3b829e5f 100644 --- a/lib/net/pool.js +++ b/lib/net/pool.js @@ -462,6 +462,9 @@ class Pool extends EventEmitter { */ async discoverSeeds(checkPeers) { + if (!this.discover) + return; + if (this.hosts.dnsSeeds.length === 0) return; @@ -3548,6 +3551,7 @@ class PoolOptions { this.services = common.LOCAL_SERVICES; this.requiredServices = common.REQUIRED_SERVICES; this.memory = true; + this.discover = true; this.fromOptions(options); } @@ -3735,9 +3739,15 @@ class PoolOptions { if (options.only.length > 0) { this.nodes = options.only; this.maxOutbound = options.only.length; + this.discover = false; } } + if (options.discover != null) { + assert(typeof options.discover === 'boolean'); + this.discover = options.discover; + } + if (options.invTimeout != null) { assert(typeof options.invTimeout === 'number'); this.invTimeout = options.invTimeout; From 3c1fda4826f06b832912eb5969df3887d6f4d898 Mon Sep 17 00:00:00 2001 From: Javed Khan Date: Fri, 1 Feb 2019 21:56:57 +0530 Subject: [PATCH 2/2] pool: fix this.options.discover --- lib/net/pool.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/net/pool.js b/lib/net/pool.js index 3b829e5f..d648f973 100644 --- a/lib/net/pool.js +++ b/lib/net/pool.js @@ -462,7 +462,7 @@ class Pool extends EventEmitter { */ async discoverSeeds(checkPeers) { - if (!this.discover) + if (!this.options.discover) return; if (this.hosts.dnsSeeds.length === 0)