Fix receiver fallbacks depend on fast polls (#1723)

This commit is contained in:
ekzyis 2024-12-13 21:19:00 +01:00 committed by GitHub
parent d73f6323ff
commit a50a2c8bd1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 3 deletions

View File

@ -58,10 +58,9 @@ export function useWalletPayment () {
// we just need to distinguish between receiver and sender errors
try {
// we always await the poll promise here to check for failed forwards since sender wallet errors
// we need to poll one more time to check for failed forwards since sender wallet errors
// can be caused by them which we want to handle as receiver errors, not sender errors.
// but we don't wait forever because real sender errors will cause the poll promise to never settle.
await withTimeout(pollPromise, FAST_POLL_INTERVAL * 2.5)
await invoiceHelper.isInvoice(latestInvoice, waitFor)
} catch (err) {
if (err instanceof WalletError) {
paymentError = err