From a9edfeb925b213b6a74c10daf358600e912aa8ce Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Fri, 10 Feb 2023 03:16:46 +0000 Subject: prevent self sends --- routes/payments.js | 2 ++ 1 file changed, 2 insertions(+) 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( -- cgit v1.2.3