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:
1 parent
c998264578
commit
3223df74e5
10 files changed
+58
-20
No files matched your search
+3
-1
@@ -675,12 +675,14 @@ func (f *Manager) start() error {
|
||||
|
||||
// Stop signals all helper goroutines to execute a graceful shutdown. This
|
||||
// method will block until all goroutines have exited.
|
||||
func (f *Manager) Stop() {
|
||||
func (f *Manager) Stop() error {
|
||||
f.stopped.Do(func() {
|
||||
log.Info("Funding manager shutting down")
|
||||
close(f.quit)
|
||||
f.wg.Wait()
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// nextPendingChanID returns the next free pending channel ID to be used to
|
||||
|
||||
Reference in new issue
Block a user