mirror of
https://github.com/tendermint/tendermint.git
synced 2026-05-28 10:00:21 +00:00
compare state equivalence instead of using bool flag
This commit is contained in:
@@ -255,6 +255,15 @@ func (cs *State) updateStateFromStore() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
eq, err := state.Equals(cs.state)
|
||||
if err != nil {
|
||||
return fmt.Errorf("comparing state: %w", err)
|
||||
}
|
||||
// if the new state is equivalent to the old state, we should not trigger a state update.
|
||||
if eq {
|
||||
return nil
|
||||
}
|
||||
|
||||
// We have no votes, so reconstruct LastCommit from SeenCommit.
|
||||
if state.LastBlockHeight > 0 {
|
||||
cs.reconstructLastCommit(state)
|
||||
|
||||
Reference in New Issue
Block a user