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

Bug: pending outgoing payment of open bolt11 invoice returns amount inferior to the one attempted to be sent #599

Closed
danielgranhao opened this issue Nov 9, 2023 · 6 comments · Fixed by #623

Comments

@danielgranhao
Copy link
Contributor

danielgranhao commented Nov 9, 2023

We've already experienced more than once that when paying an open (aka zero-amount) bolt11 invoice, if it stays pending, the amount_msat returned in Payment doesn't correspond to the amount that was attempted to be paid.

In one instance, the payment was for 50k sats, and the Payment specified ~48323 sats, and in another, it was for 45k sats, and we got ~3631 sats. Looking at the logs, for the latter, I could see that it was an MPP and one of the parts was of 3631 sats, suggesting this is related.

Not sure if this could also happen for non-open invoices, but we haven't experienced it.

@roeierez
Copy link
Member

roeierez commented Nov 9, 2023

I think it is not specific to zero amount invoice. It happens because we show the paid amount given by greenlight which probably sums the htlcs that are in flight
@kingonly what do you think? Should we change the displayed amount to the whole intended amount for sending payments instead of showing the in-flight amount?

@kingonly
Copy link
Member

kingonly commented Nov 9, 2023

@roeierez yes. Users don't need to be aware of multi htlcs.

@dleutenegger
Copy link
Contributor

Taking this up

@dleutenegger
Copy link
Contributor

Looked into this, seems like we could reuse the approach from #589 and reuse the field failed_amount_msat (happy to get suggestions about a unified name) to persist the amount the user paid and retrieve this value for Pending payments. This is necessary to support open invoices. But also depends on #570 to persist local data about Pending outgoing payments.

WDYT?

@danielgranhao
Copy link
Contributor Author

@dleutenegger

... reuse the field failed_amount_msat (happy to get suggestions about a unified name) ...

What about attempted_amount_msat?

@dangeross
Copy link
Collaborator

What about attempted_amount_msat?

I think attempted_amount_msat scans for both failed and pending payments 👍

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 a pull request may close this issue.

5 participants