From e263fe35080bcf3ef5af729b121e30dfbff81910 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Thu, 19 Jan 2023 13:37:42 -0300 Subject: fix: do not count coins with other currency --- packages/taler-wallet-core/src/operations/balance.ts | 6 ++++++ 1 file changed, 6 insertions(+) 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), -- cgit v1.2.3