diff options
| author | Adam Soltys <[email protected]> | 2025-02-12 13:40:23 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2025-02-12 13:40:23 -0800 |
| commit | b8cfc175d924a467b7c3d43e2e9b24b6b3703007 (patch) | |
| tree | 766541f49af4852c95c84dd67f36793ba83425d1 | |
| parent | 3c41b9e4ca4d988e6a7631366421f94edf7bbb97 (diff) | |
| download | coinos-server-b8cfc175d924a467b7c3d43e2e9b24b6b3703007.tar.gz coinos-server-b8cfc175d924a467b7c3d43e2e9b24b6b3703007.zip | |
catch nwc errors
| -rw-r--r-- | lib/nwc.ts | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -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); |
