diff --git a/server.go b/server.go index 4560465e6c..02d92a36d6 100644 --- a/server.go +++ b/server.go @@ -2026,8 +2026,8 @@ func (s *server) Start() error { return } - cleanup = cleanup.add(s.authGossiper.Stop) - if err := s.authGossiper.Start(); err != nil { + cleanup = cleanup.add(s.chanRouter.Stop) + if err := s.chanRouter.Start(); err != nil { startErr = err return } @@ -2043,6 +2043,13 @@ func (s *server) Start() error { startErr = err return } + // The authGossiper depends on the chanRouter and therefore + // should be started after it. + cleanup = cleanup.add(s.authGossiper.Stop) + if err := s.authGossiper.Start(); err != nil { + startErr = err + return + } cleanup = cleanup.add(s.invoices.Stop) if err := s.invoices.Start(); err != nil {