lnd: start the BestBlockTracker during server startup

This commit is contained in:
Keagan McClelland 2023-07-12 16:30:34 -06:00
parent 7c403b439c
commit 74b30a71cb

View File

@ -1901,6 +1901,12 @@ func (s *server) Start() error {
} }
cleanup = cleanup.add(s.cc.ChainNotifier.Stop) cleanup = cleanup.add(s.cc.ChainNotifier.Stop)
if err := s.cc.BestBlockTracker.Start(); err != nil {
startErr = err
return
}
cleanup = cleanup.add(s.cc.BestBlockTracker.Stop)
if err := s.channelNotifier.Start(); err != nil { if err := s.channelNotifier.Start(); err != nil {
startErr = err startErr = err
return return
@ -2282,6 +2288,10 @@ func (s *server) Stop() error {
if err := s.cc.ChainNotifier.Stop(); err != nil { if err := s.cc.ChainNotifier.Stop(); err != nil {
srvrLog.Warnf("Unable to stop ChainNotifier: %v", err) srvrLog.Warnf("Unable to stop ChainNotifier: %v", err)
} }
if err := s.cc.BestBlockTracker.Stop(); err != nil {
srvrLog.Warnf("Unable to stop BestBlockTracker: %v",
err)
}
s.chanEventStore.Stop() s.chanEventStore.Stop()
s.missionControl.StopStoreTicker() s.missionControl.StopStoreTicker()