privVal.LastSignBytes and more replay tests

This commit is contained in:
Ethan Buchman
2016-08-14 12:31:24 -04:00
parent a1c20ce866
commit 1110c5d37d
7 changed files with 177 additions and 95 deletions

View File

@ -298,8 +298,17 @@ func (cs *ConsensusState) SetPrivValidator(priv *types.PrivValidator) {
func (cs *ConsensusState) OnStart() error {
cs.QuitService.OnStart()
// start timeout and receive routines
cs.startRoutines(0)
err := cs.OpenWAL(cs.config.GetString("cswal"))
if err != nil {
return err
}
// start timeout routine
// NOTE: we dont start receiveRoutine until after replay
// so we dont re-write events, and so we dont process
// peer msgs before replay on app restarts.
// timeoutRoutine needed to read off tickChan during replay
go cs.timeoutRoutine()
// we may have lost some votes if the process crashed
// reload from consensus log to catchup
@ -308,6 +317,9 @@ func (cs *ConsensusState) OnStart() error {
// let's go for it anyways, maybe we're fine
}
// start
go cs.receiveRoutine(0)
// schedule the first round!
cs.scheduleRound0(cs.Height)