Browse Source

Treat the genesis block as unpruned, as we leave this in the HSQLDB repository.

v2.0-beta
CalDescent 3 years ago
parent
commit
d00fce86d2
  1. 5
      src/main/java/org/qortal/controller/repository/PruneManager.java

5
src/main/java/org/qortal/controller/repository/PruneManager.java

@ -146,6 +146,11 @@ public class PruneManager {
throw new DataException("Unable to determine chain tip when checking if a block is pruned"); throw new DataException("Unable to determine chain tip when checking if a block is pruned");
} }
if (height == 1) {
// We don't prune the genesis block
return false;
}
final int ourLatestHeight = chainTip.getHeight(); final int ourLatestHeight = chainTip.getHeight();
final int latestUnprunedHeight = ourLatestHeight - this.pruneBlockLimit; final int latestUnprunedHeight = ourLatestHeight - this.pruneBlockLimit;

Loading…
Cancel
Save