File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
cardano-db-sync/src/Cardano/DbSync/Era/Universal Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ insertNewEpochLedgerEvents syncEnv applyRes currentEpochNo@(EpochNo curEpoch) =
7474 handler ev =
7575 case ev of
7676 LedgerNewEpoch en ss -> do
77- validateEpochStake syncEnv applyRes
77+ validateEpochStake syncEnv applyRes True
7878 databaseCacheSize <- lift DB. queryStatementCacheSize
7979 liftIO . logInfo tracer $ " Database Statement Cache size is " <> textShow databaseCacheSize
8080 currentTime <- liftIO getCurrentTime
Original file line number Diff line number Diff line change @@ -34,8 +34,10 @@ import Cardano.DbSync.Util.Constraint
3434
3535validateEpochStake ::
3636 SyncEnv ->
37- ApplyResult -> ExceptT SyncNodeError DB. DbM ()
38- validateEpochStake syncEnv applyRes = case apOldLedger applyRes of
37+ ApplyResult ->
38+ Bool ->
39+ ExceptT SyncNodeError DB. DbM ()
40+ validateEpochStake syncEnv applyRes firstCall = case apOldLedger applyRes of
3941 Strict. Just lstate | Just (expectedCount, epoch) <- Generic. countEpochStake (clsState lstate) -> do
4042 actualCount <- lift $ DB. queryNormalEpochStakeCount (unEpochNo epoch)
4143 if actualCount /= expectedCount then do
@@ -52,6 +54,7 @@ validateEpochStake syncEnv applyRes = case apOldLedger applyRes of
5254 let slice = Generic. fullEpochStake (clsState lstate)
5355 addStakeConstraintsIfNotExist syncEnv tracer
5456 insertStakeSlice syncEnv slice
57+ when firstCall $ validateEpochStake syncEnv applyRes False
5558 else
5659 liftIO $ logInfo tracer
5760 $ mconcat
You can’t perform that action at this time.
0 commit comments