diff --git a/lib/mining/miner.js b/lib/mining/miner.js index e13ac431..d1f85a1e 100644 --- a/lib/mining/miner.js +++ b/lib/mining/miner.js @@ -321,9 +321,9 @@ Miner.prototype.createBlock = co(function* createBlock(tip, address) { version = yield this.chain.computeBlockVersion(tip); // Cheat on testnet. - // if (this.network.difficultyReset) { + // if (this.network.pow.difficultyReset) { // median = yield tip.getMedianTimeAsync(); - // ts = cheat(tip.ts, median, now); + // ts = cheat(tip.ts, median, now, this.network.pow.targetSpacing); // locktime = ts; // } @@ -548,8 +548,8 @@ function cmpRate(a, b) { return a.rate - b.rate; } -function cheat(prevTime, now, medianTime) { - var resetTime = prevTime + (20 * 60); +function cheat(prevTime, medianTime, now, targetSpacing) { + var resetTime = prevTime + (targetSpacing * 2) + 1; // Already easy. if (now <= resetTime)