Only retry same receiver if forward did not fail

This commit is contained in:
ekzyis 2024-11-27 22:38:29 +01:00
parent b301b31a46
commit 7a8db53ecf
1 changed files with 4 additions and 3 deletions

View File

@ -326,9 +326,10 @@ export async function retryPaidAction (actionType, args, incomingContext) {
withdrawl: true
}
})
if (invoiceForward) {
// TODO: receiver fallbacks
// use next receiver wallet if forward failed
// TODO: receiver fallbacks
// use next receiver wallet if forward failed (we currently immediately fallback to SN)
const failedForward = invoiceForward?.withdrawl && invoiceForward.withdrawl.actionState !== 'CONFIRMED'
if (invoiceForward && !failedForward) {
const { userId } = invoiceForward.wallet
const { invoice: bolt11, wrappedInvoice: wrappedBolt11, wallet, maxFee } = await createWrappedInvoice(userId, {
msats: failedInvoice.msatsRequested,