walletdb: use passed-in worker pool.
This commit is contained in:
parent
8f73ec53e9
commit
aec9474ba7
@ -62,6 +62,8 @@ function WalletDB(options) {
|
|||||||
|
|
||||||
this.network = this.options.network;
|
this.network = this.options.network;
|
||||||
this.logger = this.options.logger.context('wallet');
|
this.logger = this.options.logger.context('wallet');
|
||||||
|
this.workers = this.options.workers;
|
||||||
|
|
||||||
this.client = this.options.client;
|
this.client = this.options.client;
|
||||||
this.db = LDB(this.options);
|
this.db = LDB(this.options);
|
||||||
this.rpc = new RPC(this);
|
this.rpc = new RPC(this);
|
||||||
@ -2151,6 +2153,7 @@ function WalletOptions(options) {
|
|||||||
|
|
||||||
this.network = Network.primary;
|
this.network = Network.primary;
|
||||||
this.logger = Logger.global;
|
this.logger = Logger.global;
|
||||||
|
this.workers = null;
|
||||||
this.client = null;
|
this.client = null;
|
||||||
|
|
||||||
this.prefix = null;
|
this.prefix = null;
|
||||||
@ -2198,6 +2201,11 @@ WalletOptions.prototype.fromOptions = function fromOptions(options) {
|
|||||||
this.logger = options.logger;
|
this.logger = options.logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (options.workers != null) {
|
||||||
|
assert(typeof options.workers === 'object');
|
||||||
|
this.workers = options.workers;
|
||||||
|
}
|
||||||
|
|
||||||
if (options.client != null) {
|
if (options.client != null) {
|
||||||
assert(typeof options.client === 'object');
|
assert(typeof options.client === 'object');
|
||||||
this.client = options.client;
|
this.client = options.client;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user