|
@ -318,6 +318,7 @@ func (cs *ConsensusState) stepTransitionRoutine() { |
|
|
// For clarity, all state transitions that happen after some timeout are here.
|
|
|
// For clarity, all state transitions that happen after some timeout are here.
|
|
|
// Schedule the next action by pushing a RoundAction{} to cs.runActionCh.
|
|
|
// Schedule the next action by pushing a RoundAction{} to cs.runActionCh.
|
|
|
scheduleNextAction := func() { |
|
|
scheduleNextAction := func() { |
|
|
|
|
|
// NOTE: rs must be fetched in the same callstack as the caller.
|
|
|
rs := cs.getRoundState() |
|
|
rs := cs.getRoundState() |
|
|
go func() { |
|
|
go func() { |
|
|
// NOTE: We can push directly to runActionCh because
|
|
|
// NOTE: We can push directly to runActionCh because
|
|
@ -491,7 +492,8 @@ func (cs *ConsensusState) updateToState(state *sm.State, contiguous bool) { |
|
|
cs.Round = 0 |
|
|
cs.Round = 0 |
|
|
cs.Step = RoundStepNewHeight |
|
|
cs.Step = RoundStepNewHeight |
|
|
if cs.CommitTime.IsZero() { |
|
|
if cs.CommitTime.IsZero() { |
|
|
cs.StartTime = state.LastBlockTime.Add(newHeightDelta) |
|
|
|
|
|
|
|
|
//cs.StartTime = state.LastBlockTime.Add(newHeightDelta)
|
|
|
|
|
|
cs.StartTime = time.Now() // Makes it easier to sync up dev nodes.
|
|
|
} else { |
|
|
} else { |
|
|
cs.StartTime = cs.CommitTime.Add(newHeightDelta) |
|
|
cs.StartTime = cs.CommitTime.Add(newHeightDelta) |
|
|
} |
|
|
} |
|
|