diff --git a/ouroboros-consensus/src/Ouroboros/Consensus/HeaderValidation.hs b/ouroboros-consensus/src/Ouroboros/Consensus/HeaderValidation.hs index 878313cceb6..bfc8fb7565a 100644 --- a/ouroboros-consensus/src/Ouroboros/Consensus/HeaderValidation.hs +++ b/ouroboros-consensus/src/Ouroboros/Consensus/HeaderValidation.hs @@ -201,12 +201,13 @@ rewindHeaderState cfg p HeaderState{..} = do chainState' <- rewindChainState (configConsensus cfg) headerStateChain p return $ HeaderState { headerStateChain = chainState' - , headerStateTips = Seq.dropWhileR rolledBack headerStateTips + , headerStateTips = Seq.dropWhileR rollBack headerStateTips , headerStateAnchor = headerStateAnchor } where - rolledBack :: AnnTip blk -> Bool - rolledBack t = annTipPoint t > p + rollBack :: AnnTip blk -> Bool + rollBack t = At (annTipSlotNo t) > pointSlot p || + (At (annTipSlotNo t) == pointSlot p && annTipPoint t /= p) {------------------------------------------------------------------------------- Validate header envelope