-
-
Notifications
You must be signed in to change notification settings - Fork 112
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
Timeout wallet payments #1558
Comments
this is solved by #1523 |
I'll see what i can do, but the fix is a side effect of the different retrying mechanism. Anyway i am cleaning up the pr, so maybe we'll end up with fewer changes |
correction: my PR fixes only this part
the use-paid-mutation calls retryPaidAction that, with the changes in the PR, cancels the previous invoice and returns a new one for the QR code. However it doesn't change the long timeout |
Since this ticket was created because of an unresponsive territory payment, can't we control the timeout simply via low invoice expiration for invoices that pay SN from an attached wallet? We can't do this for p2p payments because we don't control the outgoing invoice and expiry of incoming invoice must be higher and have a buffer, see here: Lines 120 to 129 in 4675a2c
But stackers don't wait for these payments since they are handled in the background so I think failing fast is less important. Maybe this ticket was only about SN invoices anyway. |
We can. This issue is mostly about falling back to QR after a reasonable amount of time, so I'm not sure how that fits into what you're saying. For this case, we probably want to throw a |
Mentioning this because it seems unnecessary to me to use timeouts in our application code when we can "timeout the invoice" itself. |
Wallet payments can fail silently, e.g. the NWC consumer doesn't respond to a payment request, in which case we will wait until the invoice expires (10 minutes in most cases) - which is way too long. Stackers will assume we're unresponsive.
It's not as simple as timing out and displaying a QR code for the same invoice however. It's possible the QR code is paid and then the NWC consumer comes online and attempts to pay the same invoice. This is dangerous because once the QR code is paid, the preimage for the payment has been revealed, and the sats in the second payment can be stolen by nodes along the route that know the preimage.
To timeout safely, we'll want to cancel the original invoice, then generate a new invoice to display in the QR.
The text was updated successfully, but these errors were encountered: