Browse Source

consensus: start the timeout ticker before replay (backport #7844) (#8079)

Co-authored-by: M. J. Fromberger <fromberger@interchain.io>
Co-authored-by: Sam Kleinman <garen@tychoish.com>
pull/8089/head
William Banfield 3 years ago
committed by GitHub
parent
commit
a97bb37d44
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 9 deletions
  1. +9
    -9
      consensus/state.go

+ 9
- 9
consensus/state.go View File

@ -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 // We may have lost some votes if the process crashed reload from consensus
// log to catchup. // log to catchup.
if cs.doWALCatchup { if cs.doWALCatchup {
@ -361,15 +370,6 @@ func (cs *State) OnStart() error {
return err 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 // Double Signing Risk Reduction
if err := cs.checkDoubleSigningRisk(cs.Height); err != nil { if err := cs.checkDoubleSigningRisk(cs.Height); err != nil {
return err return err


Loading…
Cancel
Save