From aec9474ba7b89fee80545304055204d6d3321212 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Wed, 9 Aug 2017 15:45:02 -0700 Subject: [PATCH] walletdb: use passed-in worker pool. --- lib/wallet/walletdb.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/wallet/walletdb.js b/lib/wallet/walletdb.js index 0dd42a7e..e7336f4d 100644 --- a/lib/wallet/walletdb.js +++ b/lib/wallet/walletdb.js @@ -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;