aboutsummaryrefslogtreecommitdiffstats
path: root/routes
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2023-08-27 21:44:10 +0000
committerAdam Soltys <[email protected]>2023-08-27 21:44:10 +0000
commit60a79d20ab91c37a273a70d6c03336b8d5207fd6 (patch)
treea0eeff03468f712cf93f8c2a4e1cf0f1fe75104f /routes
parentc8fd7fe63f681a885fd95d9b12106b32b6729c25 (diff)
downloadcoinos-server-60a79d20ab91c37a273a70d6c03336b8d5207fd6.tar.gz
coinos-server-60a79d20ab91c37a273a70d6c03336b8d5207fd6.zip
validate amounts
Diffstat (limited to 'routes')
-rw-r--r--routes/payments.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/routes/payments.js b/routes/payments.js
index 71260e11..425561f1 100644
--- a/routes/payments.js
+++ b/routes/payments.js
@@ -233,6 +233,7 @@ export default {
async take({ body: { name, amount, hash }, user }, res) {
amount = parseInt(amount);
+ if (amount < 0) fail("Invalid amount");
await t(`pot:${name}`, async (balance, db) => {
if (balance < amount) fail("Insufficient funds");