aboutsummaryrefslogtreecommitdiffstats
path: root/routes
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2023-08-28 06:33:22 +0000
committerAdam Soltys <[email protected]>2023-09-01 22:31:18 -0700
commitcb9d32933482ccca080786697c718266023faf5b (patch)
tree81e216384f035e8876cdd5ff62c942e1e93669b9 /routes
parent675d326f3b2526d239b925e228c58c3629f02de5 (diff)
downloadcoinos-server-cb9d32933482ccca080786697c718266023faf5b.tar.gz
coinos-server-cb9d32933482ccca080786697c718266023faf5b.zip
wip
Diffstat (limited to 'routes')
-rw-r--r--routes/payments.js4
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) {