Skip to content

Commit

Permalink
consensus: start the timeout ticker before replay (backport tendermin…
Browse files Browse the repository at this point in the history
…t#7844) (tendermint#8079)

Co-authored-by: M. J. Fromberger <[email protected]>
Co-authored-by: Sam Kleinman <[email protected]>
  • Loading branch information
3 people authored and klim0v committed Apr 1, 2022
1 parent 851fb5c commit bb670c9
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions consensus/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,15 @@ func (cs *State) OnStart() error {
}
}

// we need the timeoutRoutine for replay so
// we don't block on the tick chan.
// NOTE: we will get a build up of garbage go routines
// firing on the tockChan until the receiveRoutine is started
// to deal with them (by that point, at most one will be valid)
if err := cs.timeoutTicker.Start(); err != nil {
return err
}

// We may have lost some votes if the process crashed reload from consensus
// log to catchup.
if cs.doWALCatchup {
Expand Down Expand Up @@ -361,15 +370,6 @@ func (cs *State) OnStart() error {
return err
}

// we need the timeoutRoutine for replay so
// we don't block on the tick chan.
// NOTE: we will get a build up of garbage go routines
// firing on the tockChan until the receiveRoutine is started
// to deal with them (by that point, at most one will be valid)
if err := cs.timeoutTicker.Start(); err != nil {
return err
}

// Double Signing Risk Reduction
if err := cs.checkDoubleSigningRisk(cs.Height); err != nil {
return err
Expand Down

0 comments on commit bb670c9

Please sign in to comment.