aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric P <[email protected]>2025-11-09 17:09:01 -0600
committerEric P <[email protected]>2025-11-09 17:10:04 -0600
commit3e7634fc3460d8261f9cc9c359182914b83a6a34 (patch)
treecd423680195d2d37364be50334cb6088a71c8fef
parent16e031fcf1bc91c8692a6689c8e281efb2d3b381 (diff)
downloadcoinos-server-3e7634fc3460d8261f9cc9c359182914b83a6a34.tar.gz
coinos-server-3e7634fc3460d8261f9cc9c359182914b83a6a34.zip
Catch failed keysend payments
-rw-r--r--lib/payments.ts23
1 files changed, 12 insertions, 11 deletions
diff --git a/lib/payments.ts b/lib/payments.ts
index 07048f99..bc1f5357 100644
--- a/lib/payments.ts
+++ b/lib/payments.ts
@@ -505,17 +505,18 @@ export const sendKeysend = async ({
type: PaymentType.lightning,
});
- const r = await ln.keysend({
- destination: pubkey,
- amount_msat: amount * 1000,
- maxfee: fee * 1000,
- retry_for: 10,
- extratlvs,
- });
-
- if (r.status !== "complete") reverse(p);
-
- return r;
+ try {
+ return await ln.keysend({
+ destination: pubkey,
+ amount_msat: amount * 1000,
+ maxfee: fee * 1000,
+ retry_for: 10,
+ extratlvs,
+ });
+ } catch (e) {
+ reverse(p);
+ throw e;
+ }
};
export const sendLightning = async ({