mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-30 23:53:41 +02:00
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:
@@ -87,12 +87,14 @@ func (h *HtlcNotifier) Start() error {
|
||||
}
|
||||
|
||||
// Stop signals the notifier for a graceful shutdown.
|
||||
func (h *HtlcNotifier) Stop() {
|
||||
func (h *HtlcNotifier) Stop() error {
|
||||
var err error
|
||||
h.stopped.Do(func() {
|
||||
if err := h.ntfnServer.Stop(); err != nil {
|
||||
if err = h.ntfnServer.Stop(); err != nil {
|
||||
log.Warnf("error stopping htlc notifier: %v", err)
|
||||
}
|
||||
})
|
||||
return err
|
||||
}
|
||||
|
||||
// SubscribeHtlcEvents returns a subscribe.Client that will receive updates
|
||||
|
Reference in New Issue
Block a user