Skip to content
This repository was archived by the owner on Nov 24, 2025. It is now read-only.

Commit 20551e1

Browse files
committed
Fix compacting headers
Use the compaction threshold instead of the latest block header height to calculate which headers we will need to copy over based on the minimum block header history. Fixes compaction-tests locally.
1 parent 730ae03 commit 20551e1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Chainweb/Pact/Backend/Compaction.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,7 @@ compactRocksDb logger cwVersion cids minBlockHeight srcDb targetDb = do
771771

772772
Just minBlockHeaderHistory -> do
773773
let runBack =
774-
let x = int latestHeader
774+
let x = int minBlockHeight
775775
y = minBlockHeaderHistory
776776
in if x >= y then x - y else 0
777777
iterSeek it $ RankedBlockHash (BlockHeight runBack) nullBlockHash

0 commit comments

Comments
 (0)