diff --git a/lib/net/pool.js b/lib/net/pool.js index e05c6619..ffb5aee1 100644 --- a/lib/net/pool.js +++ b/lib/net/pool.js @@ -3976,6 +3976,14 @@ PoolOptions.prototype.fromOptions = function fromOptions(options) { this.nodes = options.nodes; } + if (options.only != null) { + assert(Array.isArray(options.only)); + if (options.only.length > 0) { + this.nodes = options.only; + this.maxOutbound = options.only.length; + } + } + if (options.invTimeout != null) { assert(typeof options.invTimeout === 'number'); this.invTimeout = options.invTimeout; diff --git a/lib/node/fullnode.js b/lib/node/fullnode.js index 7cf4aa7f..4905c294 100644 --- a/lib/node/fullnode.js +++ b/lib/node/fullnode.js @@ -107,6 +107,7 @@ function FullNode(options) { upnp: this.config.bool('upnp'), seeds: this.config.array('seeds'), nodes: this.config.array('nodes'), + only: this.config.array('only'), publicHost: this.config.str('public-host'), publicPort: this.config.num('public-port'), host: this.config.str('host'), diff --git a/lib/node/spvnode.js b/lib/node/spvnode.js index 6bd56b3b..f82ebf46 100644 --- a/lib/node/spvnode.js +++ b/lib/node/spvnode.js @@ -67,6 +67,7 @@ function SPVNode(options) { upnp: this.config.bool('upnp'), seeds: this.config.array('seeds'), nodes: this.config.array('nodes'), + only: this.config.array('only'), bip151: this.config.bool('bip151'), bip150: this.config.bool('bip150'), identityKey: this.config.buf('identity-key'),