mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-09 14:43:19 +00:00
LastCommitRound should always be >= 0 for heights > 1. In State.updateToState, last precommit is computed only when round greater than -1 and has votes. But "LastCommit" is always updated regardless of the condition. If there's no last precommit, "LastCommit" is set to (*types.VoteSet)(nil). That's why "LastCommit" can be -1 for heights > 1. To fix it, only update State.RoundState.LastCommit when there is last precommit. Fixes #2737 Co-authored-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>