aboutsummaryrefslogtreecommitdiffstats
path: root/routes/assets.js
diff options
context:
space:
mode:
Diffstat (limited to 'routes/assets.js')
-rw-r--r--routes/assets.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/routes/assets.js b/routes/assets.js
index 270a3e78..9a9c6836 100644
--- a/routes/assets.js
+++ b/routes/assets.js
@@ -286,11 +286,13 @@ app.post(
ah(async (req, res) => {
const { user } = req;
const { asset, amount } = req.body;
+ amount = parseInt(amount);
try {
await db.transaction(async transaction => {
let { account } = user;
+ if (amount < 0) throw new Error("Amount to load cannot be negative");
if (account.asset !== config.liquid.btcasset)
throw new Error(
"Faucet has to be funded with bitcoin. Try sending from another wallet."