aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2025-12-04 08:46:38 -0800
committerGitHub <[email protected]>2025-12-04 08:46:38 -0800
commit1a85079296356272d04f9bb7273243921062ee92 (patch)
tree594f2c495391c676f6286e9fb372e39ff69f2cc5 /lib
parent70e727eca29a7b99d48ea9a2acd3bf39a5352cb7 (diff)
parent3e7634fc3460d8261f9cc9c359182914b83a6a34 (diff)
downloadcoinos-server-1a85079296356272d04f9bb7273243921062ee92.tar.gz
coinos-server-1a85079296356272d04f9bb7273243921062ee92.zip
Merge pull request #82 from ericpp/catch-failed-keysend
Catch failed keysend payments
Diffstat (limited to 'lib')
-rw-r--r--lib/payments.ts23
1 files changed, 12 insertions, 11 deletions
diff --git a/lib/payments.ts b/lib/payments.ts
index bbdbe2f5..e9a1ddef 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 ({