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

Attempt LNURL pay forwarding only if wallet supports it #7

Open
lirre8 opened this issue Apr 16, 2023 · 2 comments
Open

Attempt LNURL pay forwarding only if wallet supports it #7

lirre8 opened this issue Apr 16, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@lirre8
Copy link

lirre8 commented Apr 16, 2023

Currently, if the wallet receiving an LNURL pay request is online but doesn't support forwarding lightning-box will time out after 30 seconds, in which case the senders wallet most likely has timed out already causing the payment to fail. In other words, it is only possible to send LNURL pay requests to wallets that doesn't support forwarding if the wallet is offline.

What do you think about adding a field on user level whether that user supports forwarding or not? And then only attempt forwarding if they do.

@hsjoberg
Copy link
Owner

hsjoberg commented Apr 18, 2023

Hi @lirre8, thank you for opening this issue.
Indeed, the implementation is currently a bit sloppy.
As a stop-gap fix, you can set the pubkey of the user to an empty string instead of the wallet pubkey. That way an attempt to forward the payment will never occur.

@hsjoberg hsjoberg added the bug Something isn't working label Apr 18, 2023
@lirre8
Copy link
Author

lirre8 commented Apr 19, 2023

Ah right, didn't realize the pubkey was only used for the forwarding. I made this a bit more complicated fix that I'm running now: lirre8@953a4d9
Not sure if that's anything how you want it to work?

It does allow the user to have a pubkey though, which brings me to my next idea: Is there any scenario where a withdrawal from the box should be allowed to a different pubkey than the one saved on the user? Or would it be a good to check that the destination pubkey always matches the user's pubkey:

const paymentRequest = await decodePayReq(lightning, request.query.pr);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants