Merge pull request #361 from tuxcanfly/only-no-seeds
pool: --only - disable dns seed discover
This commit is contained in:
commit
a2e176d4cf
@ -462,6 +462,9 @@ class Pool extends EventEmitter {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
async discoverSeeds(checkPeers) {
|
async discoverSeeds(checkPeers) {
|
||||||
|
if (!this.options.discover)
|
||||||
|
return;
|
||||||
|
|
||||||
if (this.hosts.dnsSeeds.length === 0)
|
if (this.hosts.dnsSeeds.length === 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -3548,6 +3551,7 @@ class PoolOptions {
|
|||||||
this.services = common.LOCAL_SERVICES;
|
this.services = common.LOCAL_SERVICES;
|
||||||
this.requiredServices = common.REQUIRED_SERVICES;
|
this.requiredServices = common.REQUIRED_SERVICES;
|
||||||
this.memory = true;
|
this.memory = true;
|
||||||
|
this.discover = true;
|
||||||
|
|
||||||
this.fromOptions(options);
|
this.fromOptions(options);
|
||||||
}
|
}
|
||||||
@ -3735,9 +3739,15 @@ class PoolOptions {
|
|||||||
if (options.only.length > 0) {
|
if (options.only.length > 0) {
|
||||||
this.nodes = options.only;
|
this.nodes = options.only;
|
||||||
this.maxOutbound = options.only.length;
|
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) {
|
if (options.invTimeout != null) {
|
||||||
assert(typeof options.invTimeout === 'number');
|
assert(typeof options.invTimeout === 'number');
|
||||||
this.invTimeout = options.invTimeout;
|
this.invTimeout = options.invTimeout;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user