Skip to content

Commit

Permalink
Prune old checkpoints as opposed to new checkpoints.
Browse files Browse the repository at this point in the history
  • Loading branch information
HeinrichApfelmus committed Jun 15, 2023
1 parent 6e32039 commit 85392f0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/wallet/src/Cardano/Wallet/Checkpoints.hs
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,11 @@ extendAndPrune
-- ^ Current checkpoints.
-> DeltasCheckpoints a
extendAndPrune getSlot getHeight policy nodeTip xs (Checkpoints cps) =
prunes ++ additions
additions <> pruneOld
where
additions = reverse -- latest slot needs to be applied last
[ PutCheckpoint (getSlot x) x | x <- new ]
prunes = [ RestrictTo $ map getSlot (old ++ new) ]
pruneOld = [ RestrictTo $ map getSlot old ]

new = filter willKeep (NE.toList xs)
old = filter willKeep (Map.elems cps)
Expand Down

0 comments on commit 85392f0

Please sign in to comment.