File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
simulation/src/LeiosProtocol Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -689,8 +689,9 @@ endorseBlocksToReference cfg@LeiosConfig{variant = Full} pl EndorseBlocksSnapsho
689689 ]
690690
691691pipelinesToReferenceFromEB :: Int -> PipelineNo -> Maybe (PipelineNo , PipelineNo )
692- pipelinesToReferenceFromEB n pl =
693- case fromEnum (pred pl) - maxStagesAfterEndorse of
692+ pipelinesToReferenceFromEB n pl = do
693+ predPl <- safePred pl
694+ case fromEnum predPl - maxStagesAfterEndorse of
694695 newestIx
695696 | newestIx < 0 -> Nothing
696697 | otherwise ->
@@ -700,6 +701,9 @@ pipelinesToReferenceFromEB n pl =
700701 )
701702 where
702703 maxStagesAfterEndorse = 2
704+ safePred x = do
705+ guard $ x > minBound
706+ pure $ pred x
703707
704708shouldVoteOnEB ::
705709 LeiosConfig ->
You can’t perform that action at this time.
0 commit comments