We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 44eceb0 commit 13759d1Copy full SHA for 13759d1
cardano-db-sync/src/Cardano/DbSync/Ledger/State.hs
@@ -705,10 +705,17 @@ listMemorySnapshots env = do
705
case AS.toNewestFirst $ ledgerDbCheckpoints ldb of
706
[] -> []
707
[a] -> [a]
708
- ls -> [List.head ls, List.last ls]
+ (h : ls) -> catMaybes [Just h, lastMaybe ls]
709
notGenesis GenesisPoint = False
710
notGenesis (BlockPoint _ _) = True
711
712
+ lastMaybe :: [a] -> Maybe a
713
+ lastMaybe xs =
714
+ case xs of
715
+ [] -> Nothing
716
+ [x] -> Just x
717
+ (_ : ys) -> lastMaybe ys
718
+
719
-- Get a list of the ledger state files order most recent
720
listLedgerStateFilesOrdered :: LedgerStateDir -> IO [LedgerStateFile]
721
listLedgerStateFilesOrdered dir = do
0 commit comments