taler-typescript-core

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

commit fc93706981d8cd64ff55503d357c8092bebc7be4
parent 2afbff04553de78fd181068908b5706f0d8f4090
Author: Florian Dold <dold@taler.net>
Date:   Wed, 22 Jul 2026 10:55:09 +0200

wallet: recompute the total cost of a repaired push debit

The replacement coins carry their own fees, but the record kept the cost of
the selection made before the repair.  The pull debit already recomputes it.

Diffstat:
Mpackages/taler-wallet-core/src/pay-peer-push-debit.ts | 7+++++++
1 file changed, 7 insertions(+), 0 deletions(-)

diff --git a/packages/taler-wallet-core/src/pay-peer-push-debit.ts b/packages/taler-wallet-core/src/pay-peer-push-debit.ts @@ -581,6 +581,11 @@ async function handlePurseCreationConflict( assertUnreachable(coinSelRes); } + const totalAmount = await getTotalPeerPaymentCost( + ctx.wex, + coinSelRes.result.coins, + ); + await ctx.wex.runWalletDbTx(async (tx) => { const [rec, h] = await ctx.getRecordHandle(tx); if (!rec) { @@ -594,6 +599,8 @@ async function handlePurseCreationConflict( coinPubs: sel.coins.map((x) => x.coinPub), contributions: sel.coins.map((x) => x.contribution), }; + // The replacement coins come with their own fees. + rec.totalCost = Amounts.stringify(totalAmount); // The carried-over coins were spent when they were first selected, // the ones that replace the double-spent coin still have to be. const added = coinsAddedByRepair(repair, sel.coins);