-
Notifications
You must be signed in to change notification settings - Fork 48
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
[NUT-15] LND Support for MPP Payments #536
base: main
Are you sure you want to change the base?
Conversation
..Default::default() | ||
}) | ||
.await | ||
.map_err(|_| Error::PaymentFailed)? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wont this return here due to the use of ?
so if the payment fails the next route cannot be tried?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we only want to try more routes if we get a specific error 15 (TEMPORARY_CHANNEL_FAILURE). If we get any other kind of error then something else is up.
crates/cdk-lnd/src/lib.rs
Outdated
.map_or(0, |route| route.total_amt_msat / MSAT_IN_SAT as i64) | ||
as u64; | ||
// Detect partial payments | ||
if let Some(part_amt) = partial_amount { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: Since we care about both paths the Some
and None
we should use a match
and not if let
to be consistent with code style https://github.com/cashubtc/cdk/blob/main/CODE_STYLE.md#if-let
Description
Query the high probability routes for the public key in the invoice. Attempt the first route: if the failure code is 15 (TEMPORARY_CHANNEL_FAILURE), attempt the next route.
CHANGED
pay_invoice
: forks execution based on the presence of a partial_amount.Checklist
just final-check
before committing