diff options
| author | Adam Soltys <[email protected]> | 2023-08-27 21:44:10 +0000 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2023-08-27 21:44:10 +0000 |
| commit | 60a79d20ab91c37a273a70d6c03336b8d5207fd6 (patch) | |
| tree | a0eeff03468f712cf93f8c2a4e1cf0f1fe75104f /routes | |
| parent | c8fd7fe63f681a885fd95d9b12106b32b6729c25 (diff) | |
| download | coinos-server-60a79d20ab91c37a273a70d6c03336b8d5207fd6.tar.gz coinos-server-60a79d20ab91c37a273a70d6c03336b8d5207fd6.zip | |
validate amounts
Diffstat (limited to 'routes')
| -rw-r--r-- | routes/payments.js | 1 |
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"); |
