summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/operations/balance.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2020-09-01 23:01:44 +0530
committerFlorian Dold <florian.dold@gmail.com>2020-09-01 23:01:44 +0530
commit38e6d519461cff32107b5eebfc217fd9276960db (patch)
treeacae414baba420cfbb859af63c00370cc0baf3d1 /packages/taler-wallet-core/src/operations/balance.ts
parent5f3d9835fa1d6174da87da3882221d186f5df1b6 (diff)
downloadwallet-core-38e6d519461cff32107b5eebfc217fd9276960db.tar.gz
wallet-core-38e6d519461cff32107b5eebfc217fd9276960db.tar.bz2
wallet-core-38e6d519461cff32107b5eebfc217fd9276960db.zip
estimate refresh output, show correct(er) balance
Diffstat (limited to 'packages/taler-wallet-core/src/operations/balance.ts')
-rw-r--r--packages/taler-wallet-core/src/operations/balance.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/packages/taler-wallet-core/src/operations/balance.ts b/packages/taler-wallet-core/src/operations/balance.ts
index 26f0aaeee..47ce5f482 100644
--- a/packages/taler-wallet-core/src/operations/balance.ts
+++ b/packages/taler-wallet-core/src/operations/balance.ts
@@ -90,7 +90,10 @@ export async function getBalancesInsideTransaction(
const b = initBalance(session.amountRefreshOutput.currency);
// We are always assuming the refresh will succeed, thus we
// report the output as available balance.
- b.available = Amounts.add(session.amountRefreshOutput).amount;
+ b.available = Amounts.add(b.available, session.amountRefreshOutput).amount;
+ } else {
+ const b = initBalance(r.inputPerCoin[i].currency);
+ b.available = Amounts.add(b.available, r.estimatedOutputPerCoin[i]).amount;
}
}
});