From 2e28b65fc3d790d9fece0f3aa22f35b2012d9739 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Fri, 17 Jan 2025 08:50:11 -0800 Subject: allow mint self-payments --- routes/payments.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'routes/payments.ts') 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); -- cgit v1.2.3