From f9f89d91d37777a8696b957fd315800e17769a85 Mon Sep 17 00:00:00 2001 From: sairajzero Date: Thu, 24 Feb 2022 17:59:09 +0530 Subject: [PATCH] BugFix: consumeAsset - not working when using entire coin --- src/market.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/market.js b/src/market.js index a1575a4..c3725f9 100644 --- a/src/market.js +++ b/src/market.js @@ -48,7 +48,7 @@ const consumeAsset = (floID, asset, amount, txQueries = []) => new Promise((reso rem = 0; } else { txQueries.push(["DELETE FROM Vault WHERE id=?", [coins[i].id]]); - rem -= result[i].quantity; + rem -= coins[i].quantity; } } if (rem > 0) //should not happen AS the total and net is checked already