diff options
Diffstat (limited to 'packages/taler-wallet-core/src/recoup.ts')
-rw-r--r-- | packages/taler-wallet-core/src/recoup.ts | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/packages/taler-wallet-core/src/recoup.ts b/packages/taler-wallet-core/src/recoup.ts index be5731b0b..9adc5e2ad 100644 --- a/packages/taler-wallet-core/src/recoup.ts +++ b/packages/taler-wallet-core/src/recoup.ts @@ -199,24 +199,20 @@ async function recoupRefreshCoin( revokedCoin.exchangeBaseUrl, revokedCoin.denomPubHash, ); - checkDbInvariant(!!oldCoinDenom, `no denom for coin, hash ${oldCoin.denomPubHash}`); - checkDbInvariant(!!revokedCoinDenom, `no revoked denom for coin, hash ${revokedCoin.denomPubHash}`); + checkDbInvariant( + !!oldCoinDenom, + `no denom for coin, hash ${oldCoin.denomPubHash}`, + ); + checkDbInvariant( + !!revokedCoinDenom, + `no revoked denom for coin, hash ${revokedCoin.denomPubHash}`, + ); revokedCoin.status = CoinStatus.Dormant; - if (!revokedCoin.spendAllocation) { - // We don't know what happened to this coin - logger.error( - `can't refresh-recoup coin ${revokedCoin.coinPub}, no spendAllocation known`, - ); - } else { - let residualAmount = Amounts.sub( - revokedCoinDenom.value, - revokedCoin.spendAllocation.amount, - ).amount; - recoupGroup.scheduleRefreshCoins.push({ - coinPub: oldCoin.coinPub, - amount: Amounts.stringify(residualAmount), - }); - } + // FIXME: Schedule recoup for the sum of refreshes, based on the coin event history. + // recoupGroup.scheduleRefreshCoins.push({ + // coinPub: oldCoin.coinPub, + // amount: Amounts.stringify(refreshAmount), + // }); await tx.coins.put(revokedCoin); await tx.coins.put(oldCoin); await putGroupAsFinished(wex, tx, recoupGroup, coinIdx); |