miner: cheat on testnet.
This commit is contained in:
parent
65ddc563d6
commit
1c08beba0a
@ -321,9 +321,9 @@ Miner.prototype.createBlock = co(function* createBlock(tip, address) {
|
|||||||
version = yield this.chain.computeBlockVersion(tip);
|
version = yield this.chain.computeBlockVersion(tip);
|
||||||
|
|
||||||
// Cheat on testnet.
|
// Cheat on testnet.
|
||||||
// if (this.network.difficultyReset) {
|
// if (this.network.pow.difficultyReset) {
|
||||||
// median = yield tip.getMedianTimeAsync();
|
// median = yield tip.getMedianTimeAsync();
|
||||||
// ts = cheat(tip.ts, median, now);
|
// ts = cheat(tip.ts, median, now, this.network.pow.targetSpacing);
|
||||||
// locktime = ts;
|
// locktime = ts;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
@ -548,8 +548,8 @@ function cmpRate(a, b) {
|
|||||||
return a.rate - b.rate;
|
return a.rate - b.rate;
|
||||||
}
|
}
|
||||||
|
|
||||||
function cheat(prevTime, now, medianTime) {
|
function cheat(prevTime, medianTime, now, targetSpacing) {
|
||||||
var resetTime = prevTime + (20 * 60);
|
var resetTime = prevTime + (targetSpacing * 2) + 1;
|
||||||
|
|
||||||
// Already easy.
|
// Already easy.
|
||||||
if (now <= resetTime)
|
if (now <= resetTime)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user