aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/taler-wallet-core/src/wallet.ts10
1 files changed, 9 insertions, 1 deletions
diff --git a/packages/taler-wallet-core/src/wallet.ts b/packages/taler-wallet-core/src/wallet.ts
index d8361c6e4..2666e6eb7 100644
--- a/packages/taler-wallet-core/src/wallet.ts
+++ b/packages/taler-wallet-core/src/wallet.ts
@@ -1208,9 +1208,11 @@ async function dispatchRequestInternal<Op extends WalletApiOperation>(
case WalletApiOperation.TestCrypto: {
return await wex.cryptoApi.hashString({ str: "hello world" });
}
- case WalletApiOperation.ClearDb:
+ case WalletApiOperation.ClearDb: {
+ wex.ws.clearAllCaches();
await clearDatabase(wex.db.idbHandle());
return {};
+ }
case WalletApiOperation.Recycle: {
throw Error("not implemented");
return {};
@@ -1757,6 +1759,12 @@ export class InternalWalletState {
clientCancellationMap: Map<string, CancellationToken.Source> = new Map();
+ clearAllCaches(): void {
+ this.exchangeCache.clear();
+ this.denomInfoCache.clear();
+ this.refreshCostCache.clear();
+ }
+
initWithConfig(newConfig: WalletRunConfig): void {
this._config = newConfig;