Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lightningd: Look for channels by alias when finding channels #5846

Conversation

dongcarl
Copy link
Contributor

@dongcarl dongcarl commented Dec 22, 2022

When a channel is not yet confirmed onchain and only has an alias, getroute will (arguably correctly) return the alias under the "channel" key. However, if you supply that to sendpay, it will not be able to find the channel and will fail since it calls find_channel_for_htlc_add and that only looks for channels by their scid and doesn't consider their aliases.

This patch makes find_channel_for_htlc_add also consider channel aliases when looking for channels.

Partly resolves #5803, but not entirely.

@rustyrussell
Copy link
Contributor

Ack f61cf34

Good patch! Please add to the commit message:

Changelog-Fixed: JSON-RPC: `sendpay` now can send to a short-channel-id alias for the first hop.

@dongcarl dongcarl force-pushed the 2022-12-find_channel-consider-aliases branch from f61cf34 to 008a9dc Compare December 23, 2022 17:37
@dongcarl
Copy link
Contributor Author

Done!

When a channel is not yet confirmed onchain and only has an alias,
`getroute` will return the alias under the "channel" key. However, if
you supply that to `sendpay`, it will not be able to find the channel
and will fail since it calls `find_channel_for_htlc_add` and that only
looks for channels by their scid and doesn't consider their alias.

This patch makes `find_channel_for_htlc_add` also consider channel
aliases when looking for channels.

Changelog-Fixed: JSON-RPC: `sendpay` now can send to a short-channel-id alias for the first hop.
Copy link
Collaborator

@vincenzopalazzo vincenzopalazzo left a comment

Choose a reason for hiding this comment

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

ACK 008a9dc

@rustyrussell rustyrussell added this to the v23.02 milestone Jan 3, 2023
@rustyrussell rustyrussell merged commit 42e038b into ElementsProject:master Jan 3, 2023
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.

Peculiarities w/re paying down zeroconf channels w/ pay and getroute+sendpay
3 participants