diff options
Diffstat (limited to 'packages/taler-wallet-core/src')
-rw-r--r-- | packages/taler-wallet-core/src/balance.ts | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/packages/taler-wallet-core/src/balance.ts b/packages/taler-wallet-core/src/balance.ts index 3b53699ac..6dc0783c0 100644 --- a/packages/taler-wallet-core/src/balance.ts +++ b/packages/taler-wallet-core/src/balance.ts @@ -80,7 +80,7 @@ import { getExchangeScopeInfo, getExchangeWireDetailsInTx, } from "./exchanges.js"; -import { InternalWalletState, WalletExecutionContext } from "./wallet.js"; +import { WalletExecutionContext } from "./wallet.js"; /** * Logger. @@ -178,6 +178,10 @@ class BalancesStore { return this.balanceStore[balanceKey]; } + async addZero(currency: string, exchangeBaseUrl: string): Promise<void> { + await this.initBalance(currency, exchangeBaseUrl); + } + async addAvailable( currency: string, exchangeBaseUrl: string, @@ -304,6 +308,7 @@ export async function getBalancesInsideTransaction( await tx.coinAvailability.iter().forEachAsync(async (ca) => { const count = ca.visibleCoinCount ?? 0; + await balanceStore.addZero(ca.currency, ca.exchangeBaseUrl); for (let i = 0; i < count; i++) { await balanceStore.addAvailable( ca.currency, |