taler-typescript-core

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

commit 17243f70f959428c03c63f5524e9e4a2bf552e4d
parent aea71da861c99be16fcb98090fd07b6c46ade259
Author: Florian Dold <florian@dold.me>
Date:   Thu, 24 Apr 2025 16:46:29 +0200

util: consider melt fee for old coin in refreshV2

Diffstat:
Mpackages/taler-wallet-core/src/crypto/cryptoImplementation.ts | 4++++
1 file changed, 4 insertions(+), 0 deletions(-)

diff --git a/packages/taler-wallet-core/src/crypto/cryptoImplementation.ts b/packages/taler-wallet-core/src/crypto/cryptoImplementation.ts @@ -1467,6 +1467,10 @@ export const nativeCryptoR: TalerCryptoInterfaceR = { const currency = Amounts.currencyOf(newCoinDenoms[0].value); let valueWithFee = Amounts.zeroOfCurrency(currency); + // Melt fee of old coin. + valueWithFee = Amounts.add(valueWithFee, feeRefresh).amount; + + // Coin value and withdrawal fees for new coins. for (const ncd of newCoinDenoms) { const t = Amounts.add(ncd.value, ncd.feeWithdraw).amount; valueWithFee = Amounts.add(