aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2025-01-03 21:08:27 +0000
committerAdam Soltys <[email protected]>2025-01-03 21:09:39 +0000
commitd04594701546fee8c66141d12e834f22493e4b12 (patch)
tree35dec5b4bcdf2e0ef3bd635d60796d754fd1be75
parentf41c20702481d9419ee81219f20bcb26c2d052a4 (diff)
downloadcoinos-server-d04594701546fee8c66141d12e834f22493e4b12.tar.gz
coinos-server-d04594701546fee8c66141d12e834f22493e4b12.zip
check memo existence
-rw-r--r--lib/nwc.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/nwc.ts b/lib/nwc.ts
index 96be559a..7e3ff437 100644
--- a/lib/nwc.ts
+++ b/lib/nwc.ts
@@ -98,6 +98,7 @@ const handle = (method, params, user, ev) =>
if (payee === id) {
const invoice = await getInvoice(pr);
+ console.log("invoice", invoice, pr);
const recipient = await g(`user:${invoice.uid}`);
const { id: preimage } = await sendInternal({
@@ -107,7 +108,7 @@ const handle = (method, params, user, ev) =>
sender: user,
});
- if (invoice.memo.includes("9734")) {
+ if (invoice.memo?.includes("9734")) {
const { invoices } = await ln.listinvoices({ invstring: pr });
const inv = invoices[0];
inv.payment_preimage = preimage;