Skip to content

Commit

Permalink
fix(consensus): proposed block validity conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
lklimek committed Mar 12, 2024
1 parent 087ef94 commit 1987c49
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/consensus/state_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -477,13 +477,13 @@ func (s *StateData) isValidForPrevote() error {
return errPrevoteTimestampNotEqual
}

if !s.replayMode && !s.proposalIsTimely() {
// if this block was not validated yet, we check if it's timely
if !s.replayMode && !s.ProposalBlock.HashesTo(s.ValidBlock.Hash()) && !s.proposalIsTimely() {
return errPrevoteProposalNotTimely
}

// Validate proposal core chain lock
err := sm.ValidateBlockChainLock(s.state, s.ProposalBlock)
if err != nil {
if err := sm.ValidateBlockChainLock(s.state, s.ProposalBlock); err != nil {
return errPrevoteInvalidChainLock
}
return nil
Expand Down

0 comments on commit 1987c49

Please sign in to comment.