Skip to content

plugin: Export close_to lookup for reuse by downstream plugins - #737

Merged
cdecker merged 1 commit into
mainfrom
2026w32-close_to-openchannel
Aug 3, 2026
Merged

plugin: Export close_to lookup for reuse by downstream plugins#737
cdecker merged 1 commit into
mainfrom
2026w32-close_to-openchannel

Conversation

@cdecker

@cdecker cdecker commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

The openchannel hook handler reads the configured close_to address from
the glconf/request datastore entry. Downstream plugins that register their
own openchannel hook replace ours, since cln_plugin keeps a single handler
per 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 match chain into early returns, which is
behaviour-preserving except in one case: when close_to_addr is set but
empty, the hook previously returned {"result": "continue", "close_to": ""}
and now returns {"result": "continue"}. Omitting the field is the correct
response for "no address configured".

Split out of the wrapper-side work that consumes the helper.

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
cdecker force-pushed the 2026w32-close_to-openchannel branch from c343958 to ed1d683 Compare August 3, 2026 10:17
@cdecker
cdecker merged commit 8f86b4d into main Aug 3, 2026
16 checks passed
@cdecker
cdecker deleted the 2026w32-close_to-openchannel branch August 3, 2026 10:48
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