Skip to content

Commit

Permalink
Fix receiver fallbacks depend on fast polls (#1723)
Browse files Browse the repository at this point in the history
  • Loading branch information
ekzyis authored Dec 13, 2024
1 parent d73f632 commit a50a2c8
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions wallets/payment.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a50a2c8

Please sign in to comment.