diff --git a/pkg/consensus/consensus.go b/pkg/consensus/consensus.go index 2ced9fca8..6fc898047 100644 --- a/pkg/consensus/consensus.go +++ b/pkg/consensus/consensus.go @@ -252,8 +252,10 @@ func (s *service) Start() { // Shutdown implements Service interface. func (s *service) Shutdown() { - close(s.quit) - <-s.finished + if s.started.Load() { + close(s.quit) + <-s.finished + } } func (s *service) eventLoop() {