Correct difficulty target passsed to getNewDifficultyTarget - was received rather than previous value

This commit is contained in:
Ross Nicoll
2015-10-16 19:31:30 +01:00
parent 805b78f060
commit a2499cb31a

View File

@@ -211,7 +211,7 @@ public abstract class AbstractDogecoinParams extends NetworkParameters implement
Block blockIntervalAgo = cursor.getHeader(); Block blockIntervalAgo = cursor.getHeader();
long receivedTargetCompact = nextBlock.getDifficultyTarget(); long receivedTargetCompact = nextBlock.getDifficultyTarget();
long newTargetCompact = this.getNewDifficultyTarget(previousHeight, prev.getTimeSeconds(), long newTargetCompact = this.getNewDifficultyTarget(previousHeight, prev.getTimeSeconds(),
receivedTargetCompact, blockIntervalAgo.getTimeSeconds()); prev.getDifficultyTarget(), blockIntervalAgo.getTimeSeconds());
if (newTargetCompact != receivedTargetCompact) if (newTargetCompact != receivedTargetCompact)
throw new VerificationException("Network provided difficulty bits do not match what was calculated: " + throw new VerificationException("Network provided difficulty bits do not match what was calculated: " +