diff options
| -rw-r--r-- | routes/invoices.ts | 1 | ||||
| -rw-r--r-- | routes/payments.ts | 5 |
2 files changed, 2 insertions, 4 deletions
diff --git a/routes/invoices.ts b/routes/invoices.ts index 6f24e990..79f7b8f1 100644 --- a/routes/invoices.ts +++ b/routes/invoices.ts @@ -31,7 +31,6 @@ export default { try { res.send(await generate({ invoice, user })); } catch (e) { - console.log(e); err("problem generating invoice", e.message); bail(res, e.message); } diff --git a/routes/payments.ts b/routes/payments.ts index 3e59fb0f..ed533c76 100644 --- a/routes/payments.ts +++ b/routes/payments.ts @@ -56,9 +56,8 @@ export default { let p; if (payreq) { - const iid = await g(`invoice:${payreq}`); - if (iid) { - const invoice = await g(`invoice:${iid}`); + const invoice = await getInvoice(payreq); + if (invoice && invoice.uid !== (await g("user:mint"))) { if (invoice.aid === user.id) fail("Cannot send to self"); hash = payreq; if (!amount) ({ amount } = invoice); |
