Skip to content

Commit

Permalink
Remove duplicate quorum check in recvViewChange()
Browse files Browse the repository at this point in the history
Change-Id: I3c7fbd94641aa6785e95573867f1fdcd3d446abd
Signed-off-by: Kostas Christidis <kostas@christidis.io>
  • Loading branch information
kchristidis committed Aug 23, 2016
1 parent 9de36e3 commit 6f9ccaf
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions consensus/pbft/viewchange.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,13 +245,10 @@ func (instance *pbftCore) recvViewChange(vc *ViewChange) events.Event {
logger.Debugf("Replica %d now has %d view change requests for view %d", instance.id, quorum, instance.view)

if !instance.activeView && vc.View == instance.view && quorum >= instance.allCorrectReplicasQuorum() {
if quorum >= instance.allCorrectReplicasQuorum() {
instance.vcResendTimer.Stop()
instance.startTimer(instance.lastNewViewTimeout, "new view change")
instance.lastNewViewTimeout = 2 * instance.lastNewViewTimeout
return viewChangeQuorumEvent{}
}

instance.vcResendTimer.Stop()
instance.startTimer(instance.lastNewViewTimeout, "new view change")
instance.lastNewViewTimeout = 2 * instance.lastNewViewTimeout
return viewChangeQuorumEvent{}
}

return nil
Expand Down

0 comments on commit 6f9ccaf

Please sign in to comment.