File tree 1 file changed +5
-6
lines changed
ouroboros-consensus-cardano/src/unstable-cardano-tools/Cardano/Tools/DBAnalyser
1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -395,14 +395,14 @@ storeLedgerStateAt slotNo ledgerAppMode env = do
395
395
case runExcept $ tickThenXApply OmitLedgerEvents ledgerCfg blk (oldLedger `withLedgerTables` tbs) of
396
396
Right newLedger -> do
397
397
LedgerDB. push internal newLedger
398
- when (blockSlot blk >= slotNo) $ storeLedgerState newLedger
398
+ when (blockSlot blk >= slotNo) storeLedgerState
399
399
when (blockSlot blk > slotNo) $ issueWarning blk
400
400
when ((unBlockNo $ blockNo blk) `mod` 1000 == 0 ) $ reportProgress blk
401
401
LedgerDB. tryFlush initLedgerDB
402
402
return (continue blk, () )
403
403
Left err -> do
404
404
traceWith tracer $ LedgerErrorEvent (blockPoint blk) err
405
- storeLedgerState (oldLedger `withLedgerTables` tbs)
405
+ storeLedgerState
406
406
pure (Stop , () )
407
407
408
408
tickThenXApply = case ledgerAppMode of
@@ -419,14 +419,13 @@ storeLedgerStateAt slotNo ledgerAppMode env = do
419
419
reportProgress blk = let event = BlockSlotEvent (blockNo blk) (blockSlot blk) (blockHash blk)
420
420
in traceWith tracer event
421
421
422
- storeLedgerState :: ExtLedgerState blk mk -> IO ()
423
- storeLedgerState ledgerState = case pointSlot pt of
422
+ storeLedgerState :: IO ()
423
+ storeLedgerState =
424
+ IOLike. atomically (pointSlot <$> LedgerDB. currentPoint initLedgerDB) >>= \ case
424
425
NotOrigin slot -> do
425
426
LedgerDB. takeSnapshotNOW internal LedgerDB. TakeAtVolatileTip (Just " db-analyser" )
426
427
traceWith tracer $ SnapshotStoredEvent slot
427
428
Origin -> pure ()
428
- where
429
- pt = headerStatePoint $ headerState ledgerState
430
429
431
430
countBlocks ::
432
431
forall blk .
You can’t perform that action at this time.
0 commit comments