Call Regulator.OnPropose if cs enters/passes propose step
There are cases cs skips propose step and those case. Even in the case,
call Regulator.OnPropose for more correct proposal interval and timing
regulation.
@@ -288,6 +288,11 @@ func (cs *consensus) resetForNewRound(round int32) {
func (cs *consensus) resetForNewStep(step step) {
cs.endStep()
+ if cs.step < stepPropose && step > stepPropose {
+ now := time.Now()
+ cs.nextProposeTime = now
+ cs.c.Regulator().OnPropose(now)
+ }
cs.beginStep(step)
}
