chainntfns: close all pending client channels on shutdown for BtcdNotifier

This commit is contained in:
Olaoluwa Osuntokun 2016-02-26 17:04:14 -08:00
parent 3186b3038c
commit 77d37298f4

@ -110,6 +110,16 @@ func (b *BtcdNotifier) Stop() error {
close(b.quit)
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
}