Skip to content

Commit

Permalink
Fix: don't unconditionally do checksums on failure
Browse files Browse the repository at this point in the history
  • Loading branch information
geo2a committed Dec 10, 2024
1 parent 9a71428 commit 36a3991
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ import Ouroboros.Consensus.Ledger.Inspect
import Ouroboros.Consensus.Ledger.SupportsProtocol
import Ouroboros.Consensus.Storage.ImmutableDB.Stream
import Ouroboros.Consensus.Storage.LedgerDB.DiskPolicy
(pattern DoDiskSnapshotChecksum,
pattern NoDoDiskSnapshotChecksum)
(pattern NoDoDiskSnapshotChecksum)
import Ouroboros.Consensus.Storage.LedgerDB.LedgerDB
import Ouroboros.Consensus.Storage.LedgerDB.Query
import Ouroboros.Consensus.Storage.LedgerDB.Snapshots
Expand Down Expand Up @@ -159,8 +158,8 @@ initLedgerDB replayTracer
-- them
deleteSnapshot hasFS s
traceWith tracer $ InvalidSnapshot s err
-- always reset checksum flag after failure
tryNewestFirst DoDiskSnapshotChecksum (acc . InitFailure s err) ss
-- reset checksum flag to the initial state after failure
tryNewestFirst doChecksum (acc . InitFailure s err) ss
Right (r, l, replayed) ->
return (acc (InitFromSnapshot s r), l, replayed)

Expand Down

0 comments on commit 36a3991

Please sign in to comment.