aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2023-02-10 03:16:46 +0000
committerAdam Soltys <[email protected]>2023-02-10 03:16:54 +0000
commita9edfeb925b213b6a74c10daf358600e912aa8ce (patch)
tree2016bef79952173c35b1238a51c7758c654f1191
parent05806a56aba0b33e0485d1076186f67c83770497 (diff)
downloadcoinos-server-a9edfeb925b213b6a74c10daf358600e912aa8ce.tar.gz
coinos-server-a9edfeb925b213b6a74c10daf358600e912aa8ce.zip
prevent self sends
-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(