lightningd: notify plugins when finalizing channel #8464
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changelog-Added: Plugins now receive
channel_state_changed
notification upon final change toCLOSED
state.This is needed for plugins that want to track the set of currently user-visible channels, i.e., those that
listpeerchannels
reports. Thanks to #5381, plugins can watch for initialchannel_state_changed
notifications to know when channels have been added to the visible set, but with no notification upon transition of channels into theCLOSED
state, plugins cannot watch for channels being removed from the visible set.Note that this PR covers not quite the same use case as is covered by #8048. That PR adds a mostly redundant
channel_closed
notification that is emitted whenever a channel transitions into theCLOSINGD_COMPLETE
state (and it apparently misses the case of a unilateral closure), whereas this PR notifies plugins of a channel's final transition into theCLOSED
state (which happens later), whereafter the channel is no longer reported bylistpeerchannels
.Checklist
Before submitting the PR, ensure the following tasks are completed. If an item is not applicable to your PR, please mark it as checked:
new_state
field values indoc/developers-guide/plugin-development/event-notifications.md
, so I didn't see anywhere to note the new case.