Skip to content

Commit

Permalink
address Alessandro comment
Browse files Browse the repository at this point in the history
  • Loading branch information
melekes committed Feb 1, 2025
1 parent e05881b commit 41364a7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions consensus/cometbft/service/finalize_block.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,14 @@ func (s *Service[LoggerT]) finalizeBlockInternal(
return nil, err
}

// Special case: height > 0, but blockDelay record doesn't exist in DB.
if s.blockDelay == nil {
s.blockDelay = blockDelayUponGenesis(
req.Time,
req.Height-1,
)
}

// Calculate the delay for the next block.
delay := s.blockDelay.Next(
req.Time,
Expand Down

0 comments on commit 41364a7

Please sign in to comment.