aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2023-12-18 17:08:14 +0000
committerAdam Soltys <[email protected]>2023-12-18 17:08:14 +0000
commit48fd5545bfa4417e09923e2437316466608a4c24 (patch)
treeb9cccc23a20f341566c1c2e284a1ae35b9d99ab5
parent74d0ea356c9cdf5b393d4260c1c299c3aaac7ed6 (diff)
downloadcoinos-server-48fd5545bfa4417e09923e2437316466608a4c24.tar.gz
coinos-server-48fd5545bfa4417e09923e2437316466608a4c24.zip
logging
-rw-r--r--lib/invoices.js4
-rw-r--r--lib/nostr.js2
-rw-r--r--lib/payments.js1
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);