mirror of
https://github.com/tendermint/tendermint.git
synced 2026-04-24 01:30:32 +00:00
only include vote if it exists
This commit is contained in:
@@ -383,10 +383,10 @@ func (voteSet *VoteSet) List() []Vote {
|
||||
if voteSet == nil || voteSet.votes == nil {
|
||||
return nil
|
||||
}
|
||||
votes := make([]Vote, len(voteSet.votes))
|
||||
votes := make([]Vote, 0, len(voteSet.votes))
|
||||
for i := range voteSet.votes {
|
||||
if voteSet.votes[i] != nil {
|
||||
votes[i] = *voteSet.votes[i]
|
||||
votes = append(votes, *voteSet.votes[i])
|
||||
}
|
||||
}
|
||||
return votes
|
||||
|
||||
Reference in New Issue
Block a user