From 9c8b16bd3220d58c54dd6a2f5453b90b11905fba Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 18 May 2020 15:52:45 -0700 Subject: fee variable --- routes/assets.js | 4 ++-- routes/bitcoin/send.js | 2 +- routes/liquid/send.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/routes/assets.js b/routes/assets.js index dc3985df..1ff90e47 100644 --- a/routes/assets.js +++ b/routes/assets.js @@ -72,8 +72,8 @@ app.post("/assets", auth, async (req, res) => { }); if (Math.round(funded.fee * SATS) > account.balance) { - l.error("amount exceeds balance", asset_amount, fee, account.balance); - throw new Error("insufficient funds"); + l.error("amount exceeds balance", asset_amount, funded.fee, account.balance); + throw new Error("Insufficient funds"); } account.balance -= Math.round(funded.fee * SATS); diff --git a/routes/bitcoin/send.js b/routes/bitcoin/send.js index d9324028..b47af00e 100644 --- a/routes/bitcoin/send.js +++ b/routes/bitcoin/send.js @@ -47,7 +47,7 @@ module.exports = async (req, res) => { if (total > account.balance) { l.error("amount exceeds balance", amount, fee, account.balance); - throw new Error("insufficient funds"); + throw new Error("Insufficient funds"); } account.balance -= total; diff --git a/routes/liquid/send.js b/routes/liquid/send.js index 4d8b8d4c..5bfea060 100644 --- a/routes/liquid/send.js +++ b/routes/liquid/send.js @@ -66,7 +66,7 @@ module.exports = async (req, res) => { fee, balance: account.balance }); - throw new Error("insufficient funds"); + throw new Error("Insufficient funds"); } account.balance -= total; -- cgit v1.2.3