aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/nwc.ts16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/nwc.ts b/lib/nwc.ts
index f5b8b11b..53cda3b4 100644
--- a/lib/nwc.ts
+++ b/lib/nwc.ts
@@ -330,15 +330,15 @@ const handle = (method, params, ev, app, user) =>
if (p.amount < 0 && type === "incoming") continue;
if (p.amount > 0 && type === "outgoing") continue;
- let payment_hash;
- try {
- ({ payment_hash } =
- p.type === "lightning"
- ? p.amount > 0
+ let payment_hash = p.id;
+ if (p.type === "lightning") {
+ try {
+ ({ payment_hash } =
+ p.amount > 0
? await ln.listinvoices({ invstring: p.hash })
- : await ln.listpays({ bolt11: p.hash })
- : p.id);
- } catch (e) {}
+ : await ln.listpays({ bolt11: p.hash }));
+ } catch (e) {}
+ }
const created_at = Math.floor(p.created / 1000);