Make address optional in open-channel#159
Make address optional in open-channel#159benthecarman wants to merge 1 commit intolightningdevkit:mainfrom
open-channel#159Conversation
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.
|
I've assigned @valentinewallace as a reviewer! |
| .ok_or_else(|| { | ||
| LdkServerError::new( | ||
| InvalidRequestError, | ||
| "Address is required unless the peer is currently connected. Provide an address or connect-peer first.".to_string(), |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
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.