aboutsummaryrefslogtreecommitdiffstats
path: root/routes/payments.ts
diff options
context:
space:
mode:
Diffstat (limited to 'routes/payments.ts')
-rw-r--r--routes/payments.ts5
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);