FIX: display negative balance as zero

This commit is contained in:
Overtorment 2019-03-04 12:16:03 +00:00
parent 23e835c888
commit 77fb7c0daa

View File

@ -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 } });
});