mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-05 20:32:27 +00:00
Handle zap share payment failures gracefully
This commit is contained in:
1 parent
cf66baa745
commit
5d4baa3b56
2 files changed
+96
-18
No files matched your search
+35
-15
@@ -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(
|
||||
|
||||
Reference in new issue
Block a user