Skip to content

Commit

Permalink
Fix accounting for genesis blocks when rolling back to genesis
Browse files Browse the repository at this point in the history
  • Loading branch information
kderme authored and Cmdv committed Jun 6, 2023
1 parent bcb1060 commit da8d646
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cardano-db/src/Cardano/Db/Query.hs
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,8 @@ queryCountSlotNosGreaterThan slotNo = do
queryCountSlotNo :: MonadIO m => ReaderT SqlBackend m Word64
queryCountSlotNo = do
res <- select $ do
_ <- from $ table @Block
blk <- from $ table @Block
where_ (isJust $ blk ^. BlockSlotNo)
pure countRows
pure $ maybe 0 unValue (listToMaybe res)

Expand Down

0 comments on commit da8d646

Please sign in to comment.