File tree Expand file tree Collapse file tree
cardano-db-sync/src/Cardano/DbSync/Ledger Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -320,11 +320,13 @@ applyBlock env blk = do
320320 appResult <- atomically $ do
321321 let ledgerEventsFull = mapMaybe (convertAuxLedgerEvent (leHasRewards env)) (Consensus. lrEvents newResult)
322322 (ledgerEvents, deposits) = splitDeposits ledgerEventsFull
323- ! newLedgerState = finaliseDrepDistr $ clsState (Consensus. lrResult newResult)
324- ! details <- getSlotDetails env (ledgerState newLedgerState) time (cardanoBlockSlotNo blk)
325- ! newEpoch <- fromEitherSTM $ mkOnNewEpoch (clsState oldCls) newLedgerState (findAdaPots ledgerEvents)
326- let ! newEpochBlockNo = applyToEpochBlockNo (isByronLedger newLedgerState) (isJust newEpoch) (clsEpochBlockNo oldCls)
327- ! newState = (Consensus. lrResult newResult) {clsState = newLedgerState, clsEpochBlockNo = newEpochBlockNo}
323+ ! rawLedgerState = clsState (Consensus. lrResult newResult)
324+ ! details <- getSlotDetails env (ledgerState rawLedgerState) time (cardanoBlockSlotNo blk)
325+ ! newEpoch <- fromEitherSTM $ mkOnNewEpoch (clsState oldCls) rawLedgerState (findAdaPots ledgerEvents)
326+ let ! newLedgerState = case newEpoch of
327+ Just _ -> finaliseDrepDistr rawLedgerState
328+ Nothing -> rawLedgerState
329+ ! newState = (Consensus. lrResult newResult) {clsState = newLedgerState}
328330 pure $
329331 if leUseLedger env
330332 then
You can’t perform that action at this time.
0 commit comments