diff --git a/server.go b/server.go index 2e7bcab2..74b688cb 100644 --- a/server.go +++ b/server.go @@ -82,8 +82,8 @@ type server struct { // advertised to other nodes. globalFeatures *lnwire.FeatureVector - // localFeatures is an feature vector which represent the features which - // only affect the protocol between these two nodes. + // localFeatures is an feature vector which represent the features + // which only affect the protocol between these two nodes. localFeatures *lnwire.FeatureVector // currentNodeAnn is the node announcement that has been broadcast to @@ -91,6 +91,8 @@ type server struct { // changed since last start. currentNodeAnn *lnwire.NodeAnnouncement + quit chan struct{} + wg sync.WaitGroup } @@ -137,6 +139,8 @@ func newServer(listenAddrs []string, chanDB *channeldb.DB, cc *chainControl, globalFeatures: globalFeatures, localFeatures: localFeatures, + + quit: make(chan struct{}), } // If the debug HTLC flag is on, then we invoice a "master debug" @@ -364,6 +368,8 @@ func (s *server) Stop() error { return nil } + close(s.quit) + // Shutdown the wallet, funding manager, and the rpc server. s.cc.chainNotifier.Stop() s.chanRouter.Stop()