commit a81f545c60b5a6f8727321203e7c49f14316eb3b
parent 47b1dd91f0faedf73cdca1bca93b738180b59392
Author: Florian Dold <dold@taler.net>
Date: Thu, 3 Sep 2026 16:01:24 +0200
wallet-core: skip coins whose denomination can no longer be deposited
Only the keys update retired them, so a wallet paying right after
coming back online could spend coins the exchange then refuses.
Diffstat:
1 file changed, 12 insertions(+), 0 deletions(-)
diff --git a/packages/taler-wallet-core/src/coinSelection.ts b/packages/taler-wallet-core/src/coinSelection.ts
@@ -76,6 +76,7 @@ import {
DenominationVerificationStatus,
WalletDenomination,
} from "./db/records.js";
+import { timestampAbsoluteFromDb } from "./db/timestamps.js";
import { hasVerifiedAuditorTrust } from "./auditorTrust.js";
import {
checkExchangeInScopeTx,
@@ -2124,6 +2125,17 @@ async function selectPayCandidates(
continue;
}
if (
+ AbsoluteTime.isExpired(
+ timestampAbsoluteFromDb(denom.stampExpireDeposit),
+ )
+ ) {
+ // The exchange no longer accepts deposits of this denomination;
+ // selecting the coin would only get the payment rejected after
+ // the coins were spent.
+ logger.trace("denom can no longer be deposited");
+ continue;
+ }
+ if (
!checkExchangeAccepted(
exchangeDetails,
req.restrictExchanges,