-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
lnd: only set payment address if not empty in PaymentRequest #5419
lnd: only set payment address if not empty in PaymentRequest #5419
Conversation
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.
Solid fix! IMO the only thing missing here is updating the itests (testSingleHopInvoice
) to account for this change. Looking at the existing test case for keysend we have I don't see how this wasn't already covered, given the request is identical to the proto sample you posted in the original issue.
} | ||
copy(payIntent.paymentAddr[:], rpcPayReq.PaymentAddr) |
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.
Ahh, so this ended up copying a zero valued payment address, which was rejected as it's used as a shibboleth elsewhere in the codebase.
Ah I think the difference here is all our itests use |
Right, I was also wondering why the itest hadn't picked this up but just as you mention it is not tested for this I should have probably made it more clear in the PR! |
NP, it all makes sense now, and also explains why we didn't catch this when testing on the CLI as the CLI uses all the v2 calls. Given that we worked to move all the integration tests over to using the v2 APIs, I think this can land as is. |
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.
LGTM 🛰
Ran the itests locally, it's hitting some failures due to a regression (after 0.13) that #5429 should fix.
Background
This PR addresses an issue where not defining a payment address with the
SendPaymentRequest
results in apayment_incorrect_details
error for:Dest
andPaymentHash
instead of using an invoice withPaymentRequest
.The error occurs as not defining a payment address with the
SendPaymentRequest
results in an empty payment address byte array in thepaymentIntent
instead of a nil-value.fixes #5413