Browse Source

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

pull/7847/head
M. J. Fromberger 2 years ago
committed by GitHub
parent
commit
9e69615451
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
      internal/consensus/state.go

+ 9
- 9
internal/consensus/state.go View File

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


Loading…
Cancel
Save