taler-typescript-core

Wallet core logic and WebUIs for various components
Log | Files | Refs | Submodules | README | LICENSE

commit 52db7e6e2d6140270bec5ac971de3ff067c747a9
parent 82542fb69b48a35d2f6d45fdab43ce208652cf29
Author: Florian Dold <dold@taler.net>
Date:   Thu,  3 Sep 2026 15:47:38 +0200

wallet-core: record an expired denomination as expired, not unoffered

The exchange drops a denomination from /keys once its deposit period
ends, so the unoffered check always fired first.

Diffstat:
Mpackages/taler-wallet-core/src/exchanges.ts | 18++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/packages/taler-wallet-core/src/exchanges.ts b/packages/taler-wallet-core/src/exchanges.ts @@ -3345,18 +3345,12 @@ async function handleDenomLoss( denomsRevoked.push(coinAv.denomPubHash); const total = Amount.from(coinAv.value).mult(n); amountRevoked = amountRevoked.add(total); - } else if (!denom.isOffered) { - // Remove availability - coinAv.freshCoinCount = 0; - coinAv.visibleCoinCount = 0; - await tx.upsertCoinAvailability(coinAv); - denomsUnoffered.push(coinAv.denomPubHash); - const total = Amount.from(coinAv.value).mult(n); - amountUnoffered = amountUnoffered.add(total); } else if ( timestampExpireDeposit && AbsoluteTime.isExpired(timestampExpireDeposit) ) { + // Checked before isOffered, because the exchange drops an expired + // denomination from /keys in the same update that shows the expiry. // Remove availability coinAv.freshCoinCount = 0; coinAv.visibleCoinCount = 0; @@ -3364,6 +3358,14 @@ async function handleDenomLoss( denomsExpired.push(coinAv.denomPubHash); const total = Amount.from(coinAv.value).mult(n); amountExpired = amountExpired.add(total); + } else if (!denom.isOffered) { + // Remove availability + coinAv.freshCoinCount = 0; + coinAv.visibleCoinCount = 0; + await tx.upsertCoinAvailability(coinAv); + denomsUnoffered.push(coinAv.denomPubHash); + const total = Amount.from(coinAv.value).mult(n); + amountUnoffered = amountUnoffered.add(total); } else { // Denomination is still fine! continue;