lnwallet: cancel the spend notification when a channel's closeObserver exits
This commit ensures that when a channel’s closeObserver is signaled to exit before a channel closure has been detected, then the resources dedicated to the pending spend notification can be freed up.
This commit is contained in:
parent
78561c3e35
commit
fb9bf054cc
@ -709,9 +709,13 @@ func (lc *LightningChannel) closeObserver(channelCloseNtfn *chainntnfs.SpendEven
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Otherwise, we've be signalled to bail out early by the
|
// Otherwise, we've beeen signalled to bail out early by the
|
||||||
// caller/maintainer of this channel.
|
// caller/maintainer of this channel.
|
||||||
case <-lc.quit:
|
case <-lc.quit:
|
||||||
|
// As we're exiting before the spend notification has been
|
||||||
|
// triggered, we'll cancel the notificaiton intent so the
|
||||||
|
// ChainNotiifer can free up the resources.
|
||||||
|
channelCloseNtfn.Cancel()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user