commit 2ad69ba5809223049af3e6a07245ca7ea0a29540
parent 4cbf6d37c2b770178af3165b015461902eb5a0e2
Author: Florian Dold <florian@dold.me>
Date: Wed, 24 Jun 2026 20:37:14 +0200
wallet-core: use helper to check if exchange entry is outdated
This should resolve a discrepancy between the task to update an exchange
and the check when an exchange should be considered outdated.
Diffstat:
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/packages/taler-wallet-core/src/exchanges.ts b/packages/taler-wallet-core/src/exchanges.ts
@@ -1298,9 +1298,8 @@ export async function requireExchangeReadyTx(
// This is fatal, outer transaction will not be retried.
throw Error("exchange does not exist in database");
}
- if (
- AbsoluteTime.isExpired(timestampAbsoluteFromDb(exchange.nextUpdateStamp))
- ) {
+ const isOutdated = await checkExchangeEntryOutdated(wex, tx, exchangeBaseUrl);
+ if (isOutdated) {
logger.warn(`exchange ${exchangeBaseUrl} outdated`);
throw new OutdatedExchangeError("exchange entry outdated", exchangeBaseUrl);
}