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);
|
||||
|
||||
// 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)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user