From 48fd5545bfa4417e09923e2437316466608a4c24 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 18 Dec 2023 17:08:14 +0000 Subject: logging --- lib/invoices.js | 4 ++-- lib/nostr.js | 2 +- lib/payments.js | 1 - 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/invoices.js b/lib/invoices.js index 75b0ef39..1a1adda2 100644 --- a/lib/invoices.js +++ b/lib/invoices.js @@ -42,7 +42,7 @@ export let generate = async ({ invoice, user, sender, memo }) => { if (type === types.lightning) { let r = await ln.invoice({ amount_msat: amount ? `${amount + tip}sat` : "any", - label: new Date(), + label: id, description: memo || "", expiry: expiry || 60 * 60 * 24 * 30, deschashonly: true @@ -79,7 +79,7 @@ export let generate = async ({ invoice, user, sender, memo }) => { webhook }; - l("creating invoice", id, user.username, amount, tip, currency, invoice.hash); + l(type, "invoice", user.username, amount); await s(`invoice:${hash}`, id); await s(`invoice:${id}`, invoice); diff --git a/lib/nostr.js b/lib/nostr.js index 31fc450b..4dd14a0e 100644 --- a/lib/nostr.js +++ b/lib/nostr.js @@ -261,7 +261,7 @@ export async function handleZap(invoice) { ev.id = await calculateId(ev); ev.sig = await signId(privkey, ev.id); - l("sending receipt", JSON.stringify(ev), relays); + l("sending receipt"); await Promise.allSettled(relays.map(r => send(ev, r))); } diff --git a/lib/payments.js b/lib/payments.js index e7674f4e..dbc1e254 100644 --- a/lib/payments.js +++ b/lib/payments.js @@ -236,7 +236,6 @@ export let payLightning = async (user, payreq, amount, maxfee, memo) => { if (amount < 0 || amount > SATS || isNaN(amount)) fail("Invalid amount"); } - let total = amount; let { amount_msat, payment_hash } = await ln.decode(payreq); if (amount_msat) total = Math.round(amount_msat / 1000); -- cgit v1.2.3