aboutsummaryrefslogtreecommitdiffstats
path: root/routes
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2025-01-17 08:50:11 -0800
committerAdam Soltys <[email protected]>2025-01-17 08:50:14 -0800
commit2e28b65fc3d790d9fece0f3aa22f35b2012d9739 (patch)
tree50def7e305e411f67902c5ce67bcefca83f2054d /routes
parent2fcb16d559fb4a5c468cd608f68d1263a2c8cc51 (diff)
downloadcoinos-server-2e28b65fc3d790d9fece0f3aa22f35b2012d9739.tar.gz
coinos-server-2e28b65fc3d790d9fece0f3aa22f35b2012d9739.zip
allow mint self-payments
Diffstat (limited to 'routes')
-rw-r--r--routes/invoices.ts1
-rw-r--r--routes/payments.ts5
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);