diff options
| author | Adam Soltys <[email protected]> | 2023-08-28 06:33:22 +0000 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2023-09-01 22:31:18 -0700 |
| commit | cb9d32933482ccca080786697c718266023faf5b (patch) | |
| tree | 81e216384f035e8876cdd5ff62c942e1e93669b9 /routes | |
| parent | 675d326f3b2526d239b925e228c58c3629f02de5 (diff) | |
| download | coinos-server-cb9d32933482ccca080786697c718266023faf5b.tar.gz coinos-server-cb9d32933482ccca080786697c718266023faf5b.zip | |
wip
Diffstat (limited to 'routes')
| -rw-r--r-- | routes/payments.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/routes/payments.js b/routes/payments.js index 425561f1..c13f7bec 100644 --- a/routes/payments.js +++ b/routes/payments.js @@ -232,6 +232,7 @@ export default { }, async take({ body: { name, amount, hash }, user }, res) { + try { amount = parseInt(amount); if (amount < 0) fail("Invalid amount"); @@ -258,6 +259,9 @@ export default { await db.lPush(`pot:${name}:payments`, hash); res.send({ payment }); + } catch(e) { + bail(res, e.message); + } }, async bitcoin({ body: { txid, wallet } }, res) { |
