mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-13 05:11:21 +00:00
consensus: dont allow peer round states to decrease
This commit is contained in:
@ -797,8 +797,8 @@ func (ps *PeerState) ApplyNewRoundStepMessage(msg *NewRoundStepMessage) {
|
|||||||
ps.mtx.Lock()
|
ps.mtx.Lock()
|
||||||
defer ps.mtx.Unlock()
|
defer ps.mtx.Unlock()
|
||||||
|
|
||||||
// Ignore duplicate messages.
|
// Ignore duplicates or decreases
|
||||||
if ps.Height == msg.Height && ps.Round == msg.Round && ps.Step == msg.Step {
|
if CompareHRS(msg.Height, msg.Round, msg.Step, ps.Height, ps.Round, ps.Step) <= 0 {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1134,7 +1134,7 @@ func (cs *ConsensusState) enterCommit(height int, commitRound int) {
|
|||||||
|
|
||||||
defer func() {
|
defer func() {
|
||||||
// Done enterCommit:
|
// Done enterCommit:
|
||||||
// keep ca.Round the same, it points to the right Precommits set.
|
// keep cs.Round the same, commitRound points to the right Precommits set.
|
||||||
cs.updateRoundStep(cs.Round, RoundStepCommit)
|
cs.updateRoundStep(cs.Round, RoundStepCommit)
|
||||||
cs.CommitRound = commitRound
|
cs.CommitRound = commitRound
|
||||||
cs.newStep()
|
cs.newStep()
|
||||||
|
Reference in New Issue
Block a user