channelnotifier+discover+invoices: return error in Stop functions

In order to be consistent with other sub systems an error is now
returned from the Stop functions.
This also allows writing a generic cleanup mechanism to stop all
sub systems in case of a failure.
This commit is contained in:
Roei Erez committed 2021-04-13 13:26:01 +03:00
1 parent c998264578
commit 3223df74e5
10 files changed
+58 -20

No files matched your search

+4 -2
View File
@@ -86,10 +86,12 @@ func (c *ChannelNotifier) Start() error {
}
// Stop signals the notifier for a graceful shutdown.
func (c *ChannelNotifier) Stop() {
func (c *ChannelNotifier) Stop() error {
var err error
c.stopped.Do(func() {
c.ntfnServer.Stop()
err = c.ntfnServer.Stop()
})
return err
}
// SubscribeChannelEvents returns a subscribe.Client that will receive updates