walletdb: minor.

This commit is contained in:
Christopher Jeffrey 2016-07-15 11:25:45 -07:00
parent 5e52c7f373
commit 448771a6fe
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -51,6 +51,7 @@ function WalletDB(options) {
this.fees = options.fees;
this.logger = options.logger || bcoin.defaultLogger;
this.batches = {};
this.watchers = {};
this.workerPool = null;
// We need one read lock for `get` and `create`.
@ -76,8 +77,6 @@ function WalletDB(options) {
if (bcoin.useWorkers)
this.workerPool = new bcoin.workers();
this.watchers = {};
this._init();
}
@ -95,6 +94,12 @@ WalletDB.prototype._init = function _init() {
self.emit('error', err);
});
if (bcoin.useWorkers) {
this.workerPool.on('error', function(err) {
self.emit('error', err);
});
}
function handleEvent(event, tx, map) {
var i, path;