plugin: Export close_to lookup for reuse by downstream plugins - #737
Merged
Conversation
The openchannel hook handler reads the configured close_to address from the glconf/request datastore entry. Downstream plugins that register their own openchannel hook (replacing ours, since cln_plugin keeps one handler per hook) need the same lookup to keep applying the configured address. Extract it into a public helper, get_configured_close_to_addr, and make the hook use it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
cdecker
force-pushed
the
2026w32-close_to-openchannel
branch
from
August 3, 2026 10:17
c343958 to
ed1d683
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The
openchannelhook handler reads the configuredclose_toaddress fromthe
glconf/requestdatastore entry. Downstream plugins that register theirown
openchannelhook replace ours, sincecln_pluginkeeps a single handlerper hook, and so they lose that behaviour. To let them keep applying the
configured address, extract the lookup into a public helper,
get_configured_close_to_addr, and have the hook call it.The refactor flattens the nested
matchchain into early returns, which isbehaviour-preserving except in one case: when
close_to_addris set butempty, the hook previously returned
{"result": "continue", "close_to": ""}and now returns
{"result": "continue"}. Omitting the field is the correctresponse for "no address configured".
Split out of the wrapper-side work that consumes the helper.