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

View File

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