From 3f5d2a1ed9661fa6afc74b6f5ed9b7b72f71cb4b Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Mon, 20 Apr 2015 16:33:23 -0700 Subject: [PATCH] StartTime is equal to now when nodes start up. --- consensus/state.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/consensus/state.go b/consensus/state.go index 6352769b..9fd94f3c 100644 --- a/consensus/state.go +++ b/consensus/state.go @@ -318,6 +318,7 @@ func (cs *ConsensusState) stepTransitionRoutine() { // For clarity, all state transitions that happen after some timeout are here. // Schedule the next action by pushing a RoundAction{} to cs.runActionCh. scheduleNextAction := func() { + // NOTE: rs must be fetched in the same callstack as the caller. rs := cs.getRoundState() go func() { // 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.Step = RoundStepNewHeight 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 { cs.StartTime = cs.CommitTime.Add(newHeightDelta) }