taler-typescript-core

Wallet core logic and WebUIs for various components
Log | Files | Refs | Submodules | README | LICENSE

commit e263fe35080bcf3ef5af729b121e30dfbff81910
parent 928fe2d0195b16821dcb26db2266eef736504f30
Author: Sebastian <sebasjm@gmail.com>
Date:   Thu, 19 Jan 2023 13:37:42 -0300

fix: do not count coins with other currency

Diffstat:
Mpackages/taler-wallet-core/src/operations/balance.ts | 6++++++
1 file 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 @@ -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),