aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--routes/payments.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/routes/payments.js b/routes/payments.js
index edbcf224..40a498e5 100644
--- a/routes/payments.js
+++ b/routes/payments.js
@@ -40,6 +40,8 @@ export default {
if (msatoshi) amount = Math.round(msatoshi / 1000);
let invoice = await g(`invoice:${payment_hash}`);
+ if (invoice.uid === user.id) fail("Cannot send to self");
+
if (invoice) hash = payment_hash;
else {
p = await debit(