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

json-rpc: Check that sendpay with mpp has all the details it needs #3450

Closed
wants to merge 1 commit into from

Conversation

cdecker
Copy link
Member

@cdecker cdecker commented Jan 28, 2020

We were implicitly assuming a multi-part payment if the msatoshi argument
was specified, but then didn't check that we have all the pieces in place for
mpp. This adds a couple of additional checks to the arguments and makes it
more explicit what it means to do an mpp.

Fixes #3431

Reported-by: Sergei Tikhomirov <@s-tikhomirov>

@cdecker cdecker added this to the 0.8.1 milestone Jan 28, 2020
@cdecker cdecker requested a review from rustyrussell January 28, 2020 11:44
Copy link
Contributor

@ZmnSCPxj ZmnSCPxj left a comment

Choose a reason for hiding this comment

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

Probably the doc/lightning-sendpay.7.md should be updated as well, text reads:

The *msatoshi* amount, if provided, is the amount that will be recorded
as the target payment value. If not specified, it will be the final
amount to the destination. By default it is in millisatoshi precision; it can be a whole number, or a whole number
ending in *msat* or *sat*, or a number with three decimal places ending
in *sat*, or a number with 1 to 11 decimal places ending in *btc*.

Nary a mention of multipath in the document, yet this is supposed to signal multipath.

@rustyrussell
Copy link
Contributor

So, prior to mpp, msatoshi could be used to indicate the amount we wanted recorded as paid (e.g. the amount before fuzz or fees). We asserted that it was <= the actual amount sent. These days we keep the invoice string around for that anyway.

So this was actually a compat break. Let's just remove msatoshi argument unless mpp; I tried coding up both old and new semantics and it's a confusing mess.

Will send patch...

We were implicitly assuming a multi-part payment if the `msatoshi` argument
was specified, but then didn't check that we have all the pieces in place for
mpp. This adds a couple of additional checks to the arguments and makes it
more explicit what it means to do an mpp.

Fixes ElementsProject#3431

Reported-by: Sergei Tikhomirov <@s-tikhomirov>
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.

sendpay from plugin crashes lightningd (FATAL SIGNAL 6)
3 participants