From 98ba0e685636bfcaedd560a30192809bc2407aab Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 20 Apr 2022 15:57:15 -0700 Subject: allow address re-use --- routes/bitcoin/send.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'routes/bitcoin/send.js') 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); } -- cgit v1.2.3