aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
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 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 ({