mirror of
https://github.com/fluencelabs/tendermint
synced 2025-04-25 14:52:17 +00:00
Fix comments from review
This commit is contained in:
parent
ea4b60a602
commit
fd128c7180
@ -476,8 +476,6 @@ func (cs *ConsensusState) reconstructLastCommit(state *sm.State) {
|
|||||||
if precommit == nil {
|
if precommit == nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
// XXX reconstruct Vote from precommit after changing precommit to simpler
|
|
||||||
// structure.
|
|
||||||
added, err := lastPrecommits.AddVote(precommit)
|
added, err := lastPrecommits.AddVote(precommit)
|
||||||
if !added || err != nil {
|
if !added || err != nil {
|
||||||
PanicCrisis(Fmt("Failed to reconstruct LastCommit: %v", err))
|
PanicCrisis(Fmt("Failed to reconstruct LastCommit: %v", err))
|
||||||
|
@ -140,7 +140,7 @@ func (voteSet *VoteSet) addVote(vote *Vote) (added bool, err error) {
|
|||||||
panic("Validator index or address was not set in vote.")
|
panic("Validator index or address was not set in vote.")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make sure the step matches. (or that vote is commit && round < voteSet.round)
|
// Make sure the step matches.
|
||||||
if (vote.Height != voteSet.height) ||
|
if (vote.Height != voteSet.height) ||
|
||||||
(vote.Round != voteSet.round) ||
|
(vote.Round != voteSet.round) ||
|
||||||
(vote.Type != voteSet.type_) {
|
(vote.Type != voteSet.type_) {
|
||||||
@ -330,7 +330,7 @@ func (voteSet *VoteSet) BitArrayByBlockID(blockID BlockID) *BitArray {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// NOTE: if validator has conflicting votes, picks random.
|
// NOTE: if validator has conflicting votes, returns "canonical" vote
|
||||||
func (voteSet *VoteSet) GetByIndex(valIndex int) *Vote {
|
func (voteSet *VoteSet) GetByIndex(valIndex int) *Vote {
|
||||||
voteSet.mtx.Lock()
|
voteSet.mtx.Lock()
|
||||||
defer voteSet.mtx.Unlock()
|
defer voteSet.mtx.Unlock()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user