summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/operations/refresh.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-wallet-core/src/operations/refresh.ts')
-rw-r--r--packages/taler-wallet-core/src/operations/refresh.ts15
1 files changed, 9 insertions, 6 deletions
diff --git a/packages/taler-wallet-core/src/operations/refresh.ts b/packages/taler-wallet-core/src/operations/refresh.ts
index 5ea8fae23..17ac54cfb 100644
--- a/packages/taler-wallet-core/src/operations/refresh.ts
+++ b/packages/taler-wallet-core/src/operations/refresh.ts
@@ -78,6 +78,7 @@ import {
WalletStoresV1,
} from "../db.js";
import {
+ getCandidateWithdrawalDenomsTx,
isWithdrawableDenom,
PendingTaskType,
RefreshSessionRecord,
@@ -241,7 +242,7 @@ async function provideRefreshSession(
throw Error("db inconsistent: denomination for coin not found");
}
- // FIXME: use an index here, based on the withdrawal expiration time.
+ // FIXME: Use denom groups instead of querying all denominations!
const availableDenoms: DenominationRecord[] =
await tx.denominations.indexes.byExchangeBaseUrl
.iter(exch.exchangeBaseUrl)
@@ -975,17 +976,19 @@ export async function calculateRefreshOutput(
const denomsPerExchange: Record<string, DenominationRecord[]> = {};
+ // FIXME: Use denom groups instead of querying all denominations!
const getDenoms = async (
exchangeBaseUrl: string,
): Promise<DenominationRecord[]> => {
if (denomsPerExchange[exchangeBaseUrl]) {
return denomsPerExchange[exchangeBaseUrl];
}
- const allDenoms = await tx.denominations.indexes.byExchangeBaseUrl
- .iter(exchangeBaseUrl)
- .filter((x) => {
- return isWithdrawableDenom(x, ws.config.testing.denomselAllowLate);
- });
+ const allDenoms = await getCandidateWithdrawalDenomsTx(
+ ws,
+ tx,
+ exchangeBaseUrl,
+ currency,
+ );
denomsPerExchange[exchangeBaseUrl] = allDenoms;
return allDenoms;
};