diff --git a/lib/bcoin/miner.js b/lib/bcoin/miner.js index f2df1ba8..0609a671 100644 --- a/lib/bcoin/miner.js +++ b/lib/bcoin/miner.js @@ -217,7 +217,7 @@ Miner.prototype.stop = function stop() { Miner.prototype.createBlock = function createBlock(callback) { var self = this; - var ts = Math.max(utils.now(), this.chain.tip.ts + 1); + var ts = Math.max(bcoin.now(), this.chain.tip.ts + 1); var attempt; if (!this.loaded) { @@ -370,7 +370,7 @@ function MinerBlock(options) { version: options.version, prevBlock: this.tip.hash, merkleRoot: constants.NULL_HASH, - ts: Math.max(utils.now(), this.tip.ts + 1), + ts: Math.max(bcoin.now(), this.tip.ts + 1), bits: options.target, nonce: 0, height: this.height @@ -429,7 +429,7 @@ MinerBlock.prototype.updateMerkle = function updateMerkle() { if (this.witness) this.updateCommitment(); - this.block.ts = Math.max(utils.now(), this.tip.ts + 1); + this.block.ts = Math.max(bcoin.now(), this.tip.ts + 1); this.block.merkleRoot = this.block.getMerkleRoot('hex'); }; @@ -516,7 +516,7 @@ MinerBlock.prototype.findNonce = function findNonce() { // update the timestamp. This improves // performance because we do not have to // recalculate the merkle root. - now = utils.now(); + now = bcoin.now(); if (now > block.ts && now > tip.ts) { block.ts = now; // Overflow the nonce