Skip to content

Conversation

whitslack
Copy link
Collaborator

Changelog-Added: Plugins now receive channel_state_changed notification upon final change to CLOSED 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 initial channel_state_changed notifications to know when channels have been added to the visible set, but with no notification upon transition of channels into the CLOSED 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 the CLOSINGD_COMPLETE state (and it apparently misses the case of a unilateral closure), whereas this PR notifies plugins of a channel's final transition into the CLOSED state (which happens later), whereafter the channel is no longer reported by listpeerchannels.

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:

  • The changelog has been updated in the relevant commit(s) according to the guidelines.
  • Tests have been added or modified to reflect the changes. There probably should be an integration test for this, but I don't even begin to understand how the pytest apparatus works.
  • Documentation has been reviewed and updated as needed. There is no list of possible new_state field values in doc/developers-guide/plugin-development/event-notifications.md, so I didn't see anywhere to note the new case.
  • Related issues have been listed and linked, including any that this PR closes.

Changelog-Added: Plugins now receive `channel_state_changed` notification upon final change to `CLOSED` state.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant