mirror of
https://github.com/tendermint/tendermint.git
synced 2026-02-08 04:50:16 +00:00
Add strong guarantee in extendedCommitInfo that the number of votes corresponds
Signed-off-by: Thane Thomson <connect@thanethomson.com>
This commit is contained in:
@@ -441,6 +441,9 @@ func buildLastCommitInfo(block *types.Block, store Store, initialHeight int64) a
|
||||
// precisely to those provided in the list of votes, such that vote extensions
|
||||
// can be correlated with the votes in the commit.
|
||||
func extendedCommitInfo(c abci.CommitInfo, votes []*types.Vote) abci.ExtendedCommitInfo {
|
||||
if len(c.Votes) != len(votes) {
|
||||
panic(fmt.Sprintf("extendedCommitInfo: number of votes from commit differ from the number of votes supplied (%d != %d)", len(c.Votes), len(votes)))
|
||||
}
|
||||
vs := make([]abci.ExtendedVoteInfo, len(c.Votes))
|
||||
for i := range vs {
|
||||
var ext []byte
|
||||
|
||||
Reference in New Issue
Block a user