net: add --only option. fixes #210.
This commit is contained in:
parent
87b5375079
commit
a1d0948f2e
@ -3976,6 +3976,14 @@ PoolOptions.prototype.fromOptions = function fromOptions(options) {
|
|||||||
this.nodes = options.nodes;
|
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) {
|
if (options.invTimeout != null) {
|
||||||
assert(typeof options.invTimeout === 'number');
|
assert(typeof options.invTimeout === 'number');
|
||||||
this.invTimeout = options.invTimeout;
|
this.invTimeout = options.invTimeout;
|
||||||
|
|||||||
@ -107,6 +107,7 @@ function FullNode(options) {
|
|||||||
upnp: this.config.bool('upnp'),
|
upnp: this.config.bool('upnp'),
|
||||||
seeds: this.config.array('seeds'),
|
seeds: this.config.array('seeds'),
|
||||||
nodes: this.config.array('nodes'),
|
nodes: this.config.array('nodes'),
|
||||||
|
only: this.config.array('only'),
|
||||||
publicHost: this.config.str('public-host'),
|
publicHost: this.config.str('public-host'),
|
||||||
publicPort: this.config.num('public-port'),
|
publicPort: this.config.num('public-port'),
|
||||||
host: this.config.str('host'),
|
host: this.config.str('host'),
|
||||||
|
|||||||
@ -67,6 +67,7 @@ function SPVNode(options) {
|
|||||||
upnp: this.config.bool('upnp'),
|
upnp: this.config.bool('upnp'),
|
||||||
seeds: this.config.array('seeds'),
|
seeds: this.config.array('seeds'),
|
||||||
nodes: this.config.array('nodes'),
|
nodes: this.config.array('nodes'),
|
||||||
|
only: this.config.array('only'),
|
||||||
bip151: this.config.bool('bip151'),
|
bip151: this.config.bool('bip151'),
|
||||||
bip150: this.config.bool('bip150'),
|
bip150: this.config.bool('bip150'),
|
||||||
identityKey: this.config.buf('identity-key'),
|
identityKey: this.config.buf('identity-key'),
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user