This commit is contained in:
Christopher Jeffrey 2016-07-06 10:14:38 -07:00
parent 0dc2b41f5e
commit 20e0d6632d
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -57,13 +57,6 @@ function Miner(options) {
this.attempt = null;
this.workerPool = null;
if (bcoin.useWorkers) {
this.workerPool = new bcoin.workers({
size: this.options.parallel ? 2 : 1,
timeout: -1
});
}
this._init();
}
@ -117,6 +110,17 @@ Miner.prototype._init = function _init() {
stat.height,
stat.best);
});
if (bcoin.useWorkers) {
this.workerPool = new bcoin.workers({
size: this.options.parallel ? 2 : 1,
timeout: -1
});
this.workerPool.on('error', function(err) {
self.emit('error', err);
});
}
};
/**
@ -365,6 +369,8 @@ function MinerBlock(options) {
this._init();
}
utils.inherits(MinerBlock, EventEmitter);
/**
* Initialize the block.
* @private
@ -446,8 +452,6 @@ MinerBlock.prototype._init = function _init() {
this.updateMerkle();
};
utils.inherits(MinerBlock, EventEmitter);
/**
* Update the commitment output for segwit.
*/