diff options
| author | Adam Soltys <[email protected]> | 2025-01-17 08:50:11 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2025-01-17 08:50:14 -0800 |
| commit | 2e28b65fc3d790d9fece0f3aa22f35b2012d9739 (patch) | |
| tree | 50def7e305e411f67902c5ce67bcefca83f2054d /routes/payments.ts | |
| parent | 2fcb16d559fb4a5c468cd608f68d1263a2c8cc51 (diff) | |
| download | coinos-server-2e28b65fc3d790d9fece0f3aa22f35b2012d9739.tar.gz coinos-server-2e28b65fc3d790d9fece0f3aa22f35b2012d9739.zip | |
allow mint self-payments
Diffstat (limited to 'routes/payments.ts')
| -rw-r--r-- | routes/payments.ts | 5 |
1 files changed, 2 insertions, 3 deletions
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); |
