summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2020-05-15 17:13:30 +0530
committerFlorian Dold <florian.dold@gmail.com>2020-05-15 17:13:30 +0530
commit87f9e7b1e3e4ed78440d3b5108cfa538768644f3 (patch)
tree13b32950025654060b4d04d015e7ee25bd6ac86b /src
parentcf3eb52033a1f33cc2d47e6dfb3381a6fc34bb6a (diff)
downloadwallet-core-87f9e7b1e3e4ed78440d3b5108cfa538768644f3.tar.gz
wallet-core-87f9e7b1e3e4ed78440d3b5108cfa538768644f3.tar.bz2
wallet-core-87f9e7b1e3e4ed78440d3b5108cfa538768644f3.zip
show empty balance as soon as we have a reserve
Diffstat (limited to 'src')
-rw-r--r--src/operations/balance.ts6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/operations/balance.ts b/src/operations/balance.ts
index 6f9135028..36971c395 100644
--- a/src/operations/balance.ts
+++ b/src/operations/balance.ts
@@ -73,6 +73,11 @@ export async function getBalancesInsideTransaction(
byExchange: {},
};
+ await tx.iter(Stores.reserves).forEach((r) => {
+ const z = Amounts.getZero(r.currency);
+ addTo(balanceStore, "available", z, r.exchangeBaseUrl);
+ });
+
await tx.iter(Stores.coins).forEach((c) => {
if (c.suspended) {
return;
@@ -81,6 +86,7 @@ export async function getBalancesInsideTransaction(
addTo(balanceStore, "available", c.currentAmount, c.exchangeBaseUrl);
}
});
+
await tx.iter(Stores.refreshGroups).forEach((r) => {
// Don't count finished refreshes, since the refresh already resulted
// in coins being added to the wallet.