Skip to content

Make address optional in open-channel#159

Open
benthecarman wants to merge 1 commit intolightningdevkit:mainfrom
benthecarman:opt-channel-addr
Open

Make address optional in open-channel#159
benthecarman wants to merge 1 commit intolightningdevkit:mainfrom
benthecarman:opt-channel-addr

Conversation

@benthecarman
Copy link
Collaborator

Closes #158

Previously we always required providing the node's address when opening a channel. This was annoying because we may not even need it because we're already connected to the peer. Now we look up the node's address from our peers list if the address is not provided.

Also did the same handling as connect peer where you can provide the node and address as pk@addr instead of 2 separate args for easier use in the cli.

Previously we always required providing the node's address when opening
a channel. This was annoying because we may not even need it because
we're already connected to the peer. Now we look up the node's address
from our peers list if the address is not provided.

Also did the same handling as connect peer where you can provide the
node and address as pk@addr instead of 2 separate args for easier use in
the cli.
@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Mar 17, 2026

I've assigned @valentinewallace as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

.ok_or_else(|| {
LdkServerError::new(
InvalidRequestError,
"Address is required unless the peer is currently connected. Provide an address or connect-peer first.".to_string(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have you thought about looking up the network graph for the address of the peer ? Maybe that's too far, but pretty sure other node implementations do look at the network graph in case the address is not specified.

Copy link
Collaborator Author

@benthecarman benthecarman Mar 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From my testing, lnd doesn't do that. Not sure about CLN or eclair.

Could make sense but imo that should probably be a ldk-node feature where we iterate over all of the announced addresses trying each. We could select the first here but not really a complete feature

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.

make address optional in open-channel

3 participants