From d04594701546fee8c66141d12e834f22493e4b12 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Fri, 3 Jan 2025 21:08:27 +0000 Subject: check memo existence --- lib/nwc.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib') 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; -- cgit v1.2.3