From 77fb7c0daa74c34184c6961375fd4eaf3931b91f Mon Sep 17 00:00:00 2001 From: Overtorment Date: Mon, 4 Mar 2019 12:16:03 +0000 Subject: [PATCH] FIX: display negative balance as zero --- controllers/api.js | 1 + 1 file changed, 1 insertion(+) diff --git a/controllers/api.js b/controllers/api.js index d219d0b..ab2760b 100644 --- a/controllers/api.js +++ b/controllers/api.js @@ -253,6 +253,7 @@ router.get('/balance', async function(req, res) { if (!(await u.getAddress())) await u.generateAddress(); // onchain address needed further await u.accountForPosibleTxids(); let balance = await u.getBalance(); + if (balance < 0) balance = 0; res.send({ BTC: { AvailableBalance: balance } }); });