diff --git a/pkg/core/blockchain_test.go b/pkg/core/blockchain_test.go index 3cc4c6e11..3d359afdd 100644 --- a/pkg/core/blockchain_test.go +++ b/pkg/core/blockchain_test.go @@ -243,6 +243,7 @@ func TestSubscriptions(t *testing.T) { executionCh := make(chan *state.AppExecResult, chBufSize) bc := newTestChain(t) + defer bc.Close() bc.SubscribeForBlocks(blockCh) bc.SubscribeForTransactions(txCh) bc.SubscribeForNotifications(notificationCh) diff --git a/pkg/rpc/server/server.go b/pkg/rpc/server/server.go index 613a73345..d9299574d 100644 --- a/pkg/rpc/server/server.go +++ b/pkg/rpc/server/server.go @@ -168,17 +168,17 @@ func (s *Server) Start(errChan chan error) { s.log.Info("starting rpc-server (https)", zap.String("endpoint", s.https.Addr)) go func() { err := s.https.ListenAndServeTLS(cfg.CertFile, cfg.KeyFile) - if err != nil { + if err != http.ErrServerClosed { s.log.Error("failed to start TLS RPC server", zap.Error(err)) + errChan <- err } - errChan <- err }() } err := s.ListenAndServe() - if err != nil { + if err != http.ErrServerClosed { s.log.Error("failed to start RPC server", zap.Error(err)) + errChan <- err } - errChan <- err } // Shutdown overrides the http.Server Shutdown