walletdb: use passed-in worker pool.

This commit is contained in:
Christopher Jeffrey 2017-08-09 15:45:02 -07:00
parent 8f73ec53e9
commit aec9474ba7
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -62,6 +62,8 @@ function WalletDB(options) {
this.network = this.options.network;
this.logger = this.options.logger.context('wallet');
this.workers = this.options.workers;
this.client = this.options.client;
this.db = LDB(this.options);
this.rpc = new RPC(this);
@ -2151,6 +2153,7 @@ function WalletOptions(options) {
this.network = Network.primary;
this.logger = Logger.global;
this.workers = null;
this.client = null;
this.prefix = null;
@ -2198,6 +2201,11 @@ WalletOptions.prototype.fromOptions = function fromOptions(options) {
this.logger = options.logger;
}
if (options.workers != null) {
assert(typeof options.workers === 'object');
this.workers = options.workers;
}
if (options.client != null) {
assert(typeof options.client === 'object');
this.client = options.client;