respawn receiveRoutine so we can properly exit

Closes #2072
This commit is contained in:
Anton Kaliaev
2018-08-02 16:36:28 +04:00
parent b33f73eaf1
commit 4c5a143a70
+1 -1
View File
@@ -556,6 +556,7 @@ func (cs *ConsensusState) receiveRoutine(maxSteps int) {
defer func() {
if r := recover(); r != nil {
cs.Logger.Error("CONSENSUS FAILURE!!!", "err", r, "stack", string(debug.Stack()))
go cs.receiveRoutine(0)
}
}()
@@ -588,7 +589,6 @@ func (cs *ConsensusState) receiveRoutine(maxSteps int) {
// go to the next step
cs.handleTimeout(ti, rs)
case <-cs.Quit():
// NOTE: the internalMsgQueue may have signed messages from our
// priv_val that haven't hit the WAL, but its ok because
// priv_val tracks LastSig