mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-07-12 22:22:36 +02:00
multi: add Start and Stop methods for ChannelGraph
We do this in preparation for moving channel cache population logic out of the constructor and into the Start method. We also will later on (when topology subscription is moved to the ChannelGraph), have a goroutine that will need to be kicked off and stopped.
This commit is contained in:
@ -2377,6 +2377,12 @@ func (s *server) Start() error {
|
||||
return
|
||||
}
|
||||
|
||||
cleanup = cleanup.add(s.graphDB.Stop)
|
||||
if err := s.graphDB.Start(); err != nil {
|
||||
startErr = err
|
||||
return
|
||||
}
|
||||
|
||||
cleanup = cleanup.add(s.graphBuilder.Stop)
|
||||
if err := s.graphBuilder.Start(); err != nil {
|
||||
startErr = err
|
||||
@ -2683,6 +2689,9 @@ func (s *server) Stop() error {
|
||||
if err := s.graphBuilder.Stop(); err != nil {
|
||||
srvrLog.Warnf("failed to stop graphBuilder %v", err)
|
||||
}
|
||||
if err := s.graphDB.Stop(); err != nil {
|
||||
srvrLog.Warnf("failed to stop graphDB %v", err)
|
||||
}
|
||||
if err := s.chainArb.Stop(); err != nil {
|
||||
srvrLog.Warnf("failed to stop chainArb: %v", err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user