chainntfns/btcdnotify: close channels for all epoch clients on shutdown

This commit modifies the Stop method of the default ChainNotifier
client, the BtcdNotifier. We now close the notificaiton channel for all
the currently active block epoch clients in order to give clients a
signal that the entire daemon and possibly the ChainNotifier is
shutting down. This gives clients an extra signal to more thoroughly
implement a graceful shutdown across the daemon.
This commit is contained in:
Olaoluwa Osuntokun 2016-12-15 13:53:36 -08:00
parent a88b093843
commit f29b496b76
No known key found for this signature in database
GPG Key ID: 9CC5B105D03521A2

@ -159,6 +159,9 @@ func (b *BtcdNotifier) Stop() error {
close(confClient.negativeConf)
}
}
for _, epochClient := range b.blockEpochClients {
close(epochClient)
}
return nil
}