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

This commit is contained in:
CalDescent 2021-10-08 12:42:23 +01:00
parent abab2d1cde
commit d00fce86d2

View File

@ -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;