commit aa25cfb5f2597d220213b985221ec046197b2d53
parent e5931a52168e1ffa56b39eb724f294aaa94e3fb1
Author: Florian Dold <dold@taler.net>
Date: Thu, 3 Sep 2026 16:04:05 +0200
wallet-core: never melt a coin whose refresh already failed
The failed coin kept its session and was melted again on the next
group run; the fresh coins the exchange then issued were discarded
because the coin was no longer pending.
Diffstat:
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/packages/taler-wallet-core/src/refresh.ts b/packages/taler-wallet-core/src/refresh.ts
@@ -1049,6 +1049,9 @@ async function refreshMelt(
if (rg.timestampFinished) {
return false;
}
+ if (rg.statusPerCoin[coinIndex] !== RefreshCoinStatus.Pending) {
+ return false;
+ }
const rs = await tx.getRefreshSession(refreshGroupId, coinIndex);
if (!rs) {
return false;
@@ -1798,7 +1801,10 @@ async function processRefreshSession(
if (!refreshGroup) {
return;
}
- if (refreshGroup.statusPerCoin[coinIndex] === RefreshCoinStatus.Finished) {
+ if (refreshGroup.statusPerCoin[coinIndex] !== RefreshCoinStatus.Pending) {
+ // Finished, or failed for good. A failed coin keeps its session
+ // record, but melting it again would only hand the exchange a coin
+ // whose fresh coins the wallet no longer stores.
return;
}
if (!refreshSession) {