aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2023-01-19 13:37:42 -0300
committerSebastian <sebasjm@gmail.com>2023-01-19 13:37:42 -0300
commite263fe35080bcf3ef5af729b121e30dfbff81910 (patch)
treee5c9a552c8900100040f13f2d8256a4cdaa94105
parent928fe2d0195b16821dcb26db2266eef736504f30 (diff)
downloadwallet-core-e263fe35080bcf3ef5af729b121e30dfbff81910.tar.xz
fix: do not count coins with other currency
-rw-r--r--packages/taler-wallet-core/src/operations/balance.ts6
1 files changed, 6 insertions, 0 deletions
diff --git a/packages/taler-wallet-core/src/operations/balance.ts b/packages/taler-wallet-core/src/operations/balance.ts
index 2c57f8af8..27b801804 100644
--- a/packages/taler-wallet-core/src/operations/balance.ts
+++ b/packages/taler-wallet-core/src/operations/balance.ts
@@ -379,6 +379,9 @@ export async function getMerchantPaymentBalanceDetails(
])
.runReadOnly(async (tx) => {
await tx.coinAvailability.iter().forEach((ca) => {
+ if (ca.currency != req.currency) {
+ return;
+ }
const singleCoinAmount: AmountJson = {
currency: ca.currency,
fraction: ca.amountFrac,
@@ -413,6 +416,9 @@ export async function getMerchantPaymentBalanceDetails(
});
await tx.refreshGroups.iter().forEach((r) => {
+ if (r.currency != req.currency) {
+ return;
+ }
d.balanceAvailable = Amounts.add(
d.balanceAvailable,
computeRefreshGroupAvailableAmount(r),