Browse Source

Merge pull request #179 from lgedgar/log-invalid-timestamps

Add debug logging when invalid timestamp is encountered
pull/182/head
AlphaX-Projects 7 months ago committed by GitHub
parent
commit
ce8fb002cc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 6
      src/main/java/org/qortal/block/Block.java

6
src/main/java/org/qortal/block/Block.java

@ -1061,8 +1061,10 @@ public class Block {
return ValidationResult.MINTER_NOT_ACCEPTED;
long expectedTimestamp = calcTimestamp(parentBlockData, this.blockData.getMinterPublicKey(), minterLevel);
if (this.blockData.getTimestamp() != expectedTimestamp)
return ValidationResult.TIMESTAMP_INCORRECT;
if (this.blockData.getTimestamp() != expectedTimestamp) {
LOGGER.debug(String.format("timestamp mismatch! block had %s but we expected %s", this.blockData.getTimestamp(), expectedTimestamp));
return ValidationResult.TIMESTAMP_INCORRECT;
}
return ValidationResult.OK;
}

Loading…
Cancel
Save