Handle zap share payment failures gracefully

This commit is contained in:
thePR0M3TH3AN committed 2025-10-27 21:52:23 -04:00
1 parent cf66baa745
commit 5d4baa3b56
2 files changed
+96 -18

No files matched your search

+35 -15
View File
@@ -367,22 +367,42 @@ async function processShare({
zapRequest,
});
const payment = await deps.wallet.sendPayment(invoice.invoice, {
amountSats,
zapRequest,
lnurl: resolved.url,
});
try {
const payment = await deps.wallet.sendPayment(invoice.invoice, {
amountSats,
zapRequest,
lnurl: resolved.url,
});
return {
recipientType,
address,
amount: amountSats,
lnurl: resolved,
metadata,
invoice,
payment,
zapRequest,
};
return {
recipientType,
address,
amount: amountSats,
lnurl: resolved,
metadata,
invoice,
payment,
zapRequest,
status: "ok",
};
} catch (error) {
userLogger.warn(
`[zapSplit] Failed to send ${recipientType} zap share.`,
error
);
return {
recipientType,
address,
amount: amountSats,
lnurl: resolved,
metadata,
invoice,
payment: null,
zapRequest,
status: "error",
error,
};
}
}
export async function splitAndZap(