Skip to content

Attempt LNURL pay forwarding only if wallet supports it #7

Open

Description

@lirre8

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.

Activity

  1. hsjoberg commented on Apr 18, 2023

    @hsjoberg
    Owner

    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.

  2. lirre8 commented on Apr 19, 2023

    @lirre8
    Author

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions