From d00fce86d200576f6c43d5b986a132520163a2d4 Mon Sep 17 00:00:00 2001 From: CalDescent Date: Fri, 8 Oct 2021 12:42:23 +0100 Subject: [PATCH] Treat the genesis block as unpruned, as we leave this in the HSQLDB repository. --- .../java/org/qortal/controller/repository/PruneManager.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/org/qortal/controller/repository/PruneManager.java b/src/main/java/org/qortal/controller/repository/PruneManager.java index 5202d5c1..ec27456f 100644 --- a/src/main/java/org/qortal/controller/repository/PruneManager.java +++ b/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"); } + if (height == 1) { + // We don't prune the genesis block + return false; + } + final int ourLatestHeight = chainTip.getHeight(); final int latestUnprunedHeight = ourLatestHeight - this.pruneBlockLimit;