aboutsummaryrefslogtreecommitdiffstats
path: root/routes/bitcoin/send.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2022-04-20 15:57:15 -0700
committerAdam Soltys <[email protected]>2022-04-20 15:57:20 -0700
commit98ba0e685636bfcaedd560a30192809bc2407aab (patch)
tree94e1f7e83fdd30ff439dc5536ee945e999d5ae8c /routes/bitcoin/send.js
parentd72de475b6621fb6ef31c03c2cf4d3ca1e82f5f2 (diff)
downloadcoinos-server-98ba0e685636bfcaedd560a30192809bc2407aab.tar.gz
coinos-server-98ba0e685636bfcaedd560a30192809bc2407aab.zip
allow address re-use
Diffstat (limited to 'routes/bitcoin/send.js')
-rw-r--r--routes/bitcoin/send.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/routes/bitcoin/send.js b/routes/bitcoin/send.js
index fe2b2862..9d64bb59 100644
--- a/routes/bitcoin/send.js
+++ b/routes/bitcoin/send.js
@@ -54,7 +54,7 @@ module.exports = ah(async (req, res) => {
if (total > account.balance) {
l.error("amount exceeds balance", amount, fee, account.balance);
- throw new Error("Insufficient funds");
+ throw new Error("low balance");
}
await account.decrement({ balance: total }, { transaction });
@@ -92,6 +92,7 @@ module.exports = ah(async (req, res) => {
payments.push(params.hash);
l.info("sent bitcoin", user.username, total);
} catch (e) {
+ if (e.message.includes("Insufficient")) e.message = "The coinos server hot wallet has insufficient funds to complete the payment, try again later";
l.error("error sending bitcoin", e.message);
return res.status(500).send(e.message);
}