commit 58b554d2d95985b4bd167cad040b0fac7cdd11ea
parent 28d7a26bf9af4dae70237082c5b72e625dd2558b
Author: Florian Dold <florian@dold.me>
Date: Thu, 17 Oct 2024 11:11:03 +0200
wallet-core: mark user-added exchanges as used
Diffstat:
1 file changed, 6 insertions(+), 0 deletions(-)
diff --git a/packages/taler-wallet-core/src/wallet.ts b/packages/taler-wallet-core/src/wallet.ts
@@ -279,6 +279,7 @@ import {
handleTestingWaitExchangeWalletKyc,
listExchanges,
lookupExchangeByUri,
+ markExchangeUsed,
} from "./exchanges.js";
import { convertDepositAmount } from "./instructedAmountConversion.js";
import {
@@ -910,6 +911,11 @@ async function handleAddExchange(
req: AddExchangeRequest,
): Promise<EmptyObject> {
await fetchFreshExchange(wex, req.exchangeBaseUrl, {});
+ // Exchange has been explicitly added upon user request.
+ // Thus, we mark it as "used".
+ await wex.db.runAllStoresReadWriteTx({}, async (tx) => {
+ await markExchangeUsed(wex, tx, req.exchangeBaseUrl);
+ });
return {};
}