chainntfns: close all pending client channels on shutdown for BtcdNotifier
This commit is contained in:
parent
3186b3038c
commit
77d37298f4
@ -110,6 +110,16 @@ func (b *BtcdNotifier) Stop() error {
|
|||||||
close(b.quit)
|
close(b.quit)
|
||||||
b.wg.Wait()
|
b.wg.Wait()
|
||||||
|
|
||||||
|
// Notify all pending clients of our shutdown by closing the related
|
||||||
|
// notification channels.
|
||||||
|
for _, spendClient := range b.spendNotifications {
|
||||||
|
close(spendClient.spendChan)
|
||||||
|
}
|
||||||
|
for _, confClient := range b.confNotifications {
|
||||||
|
close(confClient.finConf)
|
||||||
|
close(confClient.negativeConf)
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user