diff options
| author | Adam Soltys <[email protected]> | 2023-02-10 03:16:46 +0000 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2023-02-10 03:16:54 +0000 |
| commit | a9edfeb925b213b6a74c10daf358600e912aa8ce (patch) | |
| tree | 2016bef79952173c35b1238a51c7758c654f1191 | |
| parent | 05806a56aba0b33e0485d1076186f67c83770497 (diff) | |
| download | coinos-server-a9edfeb925b213b6a74c10daf358600e912aa8ce.tar.gz coinos-server-a9edfeb925b213b6a74c10daf358600e912aa8ce.zip | |
prevent self sends
| -rw-r--r-- | routes/payments.js | 2 |
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( |
