multi: make sure missionControlStore catches done signal

This commit makes sure `missionControlStore` catches the shutdown signal
when draining the ticker. A few debug logs are added to aid the process.
This commit is contained in:
yyforyongyu committed 2024-07-23 21:30:08 +08:00
1 parent 50279464ad
commit 2608c0893e
6 files changed
+25 -10

No files matched your search

+3 -2
View File
@@ -125,6 +125,9 @@ func (b *BitcoindFilteredChainView) Start() error {
//
// NOTE: This is part of the FilteredChainView interface.
func (b *BitcoindFilteredChainView) Stop() error {
log.Debug("BitcoindFilteredChainView stopping")
defer log.Debug("BitcoindFilteredChainView stopped")
// Already shutting down?
if atomic.AddInt32(&b.stopped, 1) != 1 {
return nil
@@ -136,8 +139,6 @@ func (b *BitcoindFilteredChainView) Stop() error {
b.blockQueue.Stop()
log.Infof("FilteredChainView stopping")
close(b.quit)
b.wg.Wait()