service: change stop interface (#7816)

This commit is contained in:
Sam Kleinman
2022-02-17 11:23:32 -05:00
committed by GitHub
parent 38e29590ff
commit 28d34d635c
30 changed files with 129 additions and 226 deletions
+1 -5
View File
@@ -219,11 +219,7 @@ func (r *Reactor) OnStart(ctx context.Context) error {
func (r *Reactor) OnStop() {
r.unsubscribeFromBroadcastEvents()
if err := r.state.Stop(); err != nil {
if !errors.Is(err, service.ErrAlreadyStopped) {
r.logger.Error("failed to stop consensus state", "err", err)
}
}
r.state.Stop()
if !r.WaitSync() {
r.state.Wait()