miner.
This commit is contained in:
parent
0dc2b41f5e
commit
20e0d6632d
@ -57,13 +57,6 @@ function Miner(options) {
|
|||||||
this.attempt = null;
|
this.attempt = null;
|
||||||
this.workerPool = null;
|
this.workerPool = null;
|
||||||
|
|
||||||
if (bcoin.useWorkers) {
|
|
||||||
this.workerPool = new bcoin.workers({
|
|
||||||
size: this.options.parallel ? 2 : 1,
|
|
||||||
timeout: -1
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
this._init();
|
this._init();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -117,6 +110,17 @@ Miner.prototype._init = function _init() {
|
|||||||
stat.height,
|
stat.height,
|
||||||
stat.best);
|
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();
|
this._init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
utils.inherits(MinerBlock, EventEmitter);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the block.
|
* Initialize the block.
|
||||||
* @private
|
* @private
|
||||||
@ -446,8 +452,6 @@ MinerBlock.prototype._init = function _init() {
|
|||||||
this.updateMerkle();
|
this.updateMerkle();
|
||||||
};
|
};
|
||||||
|
|
||||||
utils.inherits(MinerBlock, EventEmitter);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update the commitment output for segwit.
|
* Update the commitment output for segwit.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user