Browse Source

Update condition based on Jae input

pull/1569/head
Zarko Milosevic 7 years ago
committed by Ethan Buchman
parent
commit
01ac378c96
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      consensus/state.go

+ 2
- 2
consensus/state.go View File

@ -1322,7 +1322,7 @@ func (cs *ConsensusState) addProposalBlockPart(height int64, part *types.Part, v
blockID, ok := prevotes.TwoThirdsMajority() blockID, ok := prevotes.TwoThirdsMajority()
if ok && !blockID.IsZero() && (cs.ValidRound < cs.Round) { if ok && !blockID.IsZero() && (cs.ValidRound < cs.Round) {
// update valid value // update valid value
if !cs.ValidBlock.HashesTo(blockID.Hash) && cs.ProposalBlock.HashesTo(blockID.Hash) {
if cs.ProposalBlock.HashesTo(blockID.Hash) {
cs.ValidRound = cs.Round cs.ValidRound = cs.Round
cs.ValidBlock = cs.ProposalBlock cs.ValidBlock = cs.ProposalBlock
cs.ValidBlockParts = cs.ProposalBlockParts cs.ValidBlockParts = cs.ProposalBlockParts
@ -1440,7 +1440,7 @@ func (cs *ConsensusState) addVote(vote *types.Vote, peerID p2p.ID) (added bool,
// Update ValidBlock // Update ValidBlock
if ok && !blockID.IsZero() && (cs.ValidRound < vote.Round) && (vote.Round <= cs.Round) { if ok && !blockID.IsZero() && (cs.ValidRound < vote.Round) && (vote.Round <= cs.Round) {
// update valid value // update valid value
if !cs.ValidBlock.HashesTo(blockID.Hash) && cs.ProposalBlock.HashesTo(blockID.Hash) {
if cs.ProposalBlock.HashesTo(blockID.Hash) {
cs.ValidRound = vote.Round cs.ValidRound = vote.Round
cs.ValidBlock = cs.ProposalBlock cs.ValidBlock = cs.ProposalBlock
cs.ValidBlockParts = cs.ProposalBlockParts cs.ValidBlockParts = cs.ProposalBlockParts


Loading…
Cancel
Save