Skip to content

Commit 6f9ccaf

Browse files
committed
Remove duplicate quorum check in recvViewChange()
Change-Id: I3c7fbd94641aa6785e95573867f1fdcd3d446abd Signed-off-by: Kostas Christidis <[email protected]>
1 parent 9de36e3 commit 6f9ccaf

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

consensus/pbft/viewchange.go

+4-7
Original file line numberDiff line numberDiff line change
@@ -245,13 +245,10 @@ func (instance *pbftCore) recvViewChange(vc *ViewChange) events.Event {
245245
logger.Debugf("Replica %d now has %d view change requests for view %d", instance.id, quorum, instance.view)
246246

247247
if !instance.activeView && vc.View == instance.view && quorum >= instance.allCorrectReplicasQuorum() {
248-
if quorum >= instance.allCorrectReplicasQuorum() {
249-
instance.vcResendTimer.Stop()
250-
instance.startTimer(instance.lastNewViewTimeout, "new view change")
251-
instance.lastNewViewTimeout = 2 * instance.lastNewViewTimeout
252-
return viewChangeQuorumEvent{}
253-
}
254-
248+
instance.vcResendTimer.Stop()
249+
instance.startTimer(instance.lastNewViewTimeout, "new view change")
250+
instance.lastNewViewTimeout = 2 * instance.lastNewViewTimeout
251+
return viewChangeQuorumEvent{}
255252
}
256253

257254
return nil

0 commit comments

Comments
 (0)