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

Expand PaymentClaimable to include all inbound channel IDs for a payment #3655

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

shaavan
Copy link
Member

@shaavan shaavan commented Mar 8, 2025

Resolves #2274

This PR expands PaymentClaimable to include all inbound channel_ids and user_channel_ids associated with a payment.
This update ensures a clearer representation of the channels used, especially for MPP payments.

shaavan added 2 commits March 8, 2025 18:33
These two utilities will be used in following commit to get all the
inbound channel_ids, and user_channel_ids associated with all the
parts of a payment.
…imable` for MPP clarity

Previously, `channel_id` in `PaymentClaimable` only listed a single
inbound channel, which was misleading for MPP payments arriving via
multiple channels.

To better represent MPP scenarios, this update introduces:
- `via_channel_ids`: A list of all inbound channels used in the payment.
- `via_user_channel_ids`: The corresponding user-defined channel IDs for
  each inbound channel.

This change ensures a more accurate representation of multi-path payments
while maintaining backward compatibility.
@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Mar 8, 2025

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.

@shaavan
Copy link
Member Author

shaavan commented Mar 8, 2025

@benthecarman

Would also be nice if the same information is available on the PaymentClaimed event too

In the current version, I haven’t included channel_ids and user_channel_ids for PaymentClaimed, as they can be easily derived from the event itself:

let channel_ids = payment_claimed_event.htlcs.iter().map(|htlc| htlc.channel_id).collect();

That said, let me know if you’d still prefer to include channel_ids in PaymentClaimed, and I'd be happy to make that change. Thanks!

@benthecarman
Copy link
Contributor

Thanks, @shaavan , that is good enough

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.

PaymentClaimable lists inbound channel id
3 participants