taler-typescript-core

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

commit 1f8a17b3dc1d7ae0fe17cd3bc47687e014ac459a
parent 74eead878dbb935d1f3dd35941e15baadc687c76
Author: Florian Dold <dold@taler.net>
Date:   Wed, 22 Jul 2026 10:57:55 +0200

wallet: keep searching for a refresh coin past a coin that is too small

The scan stopped at the first denomination that left no change, justified by
an ordering the list does not have: it is ranked by fee rate, not by value.

Diffstat:
Mpackages/taler-wallet-core/src/instructedAmountConversion.ts | 7++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/packages/taler-wallet-core/src/instructedAmountConversion.ts b/packages/taler-wallet-core/src/instructedAmountConversion.ts @@ -472,9 +472,10 @@ function searchBestRefreshCoin( const changeAfterDeposit = Amounts.sub(denomContribution, amount).amount; if (Amounts.isZero(changeAfterDeposit)) { - //this coin is not big enough to use for refresh - //since the list is sorted, we can break here - break refreshIteration; + // This coin leaves nothing to refresh. The list is ordered by fee + // rate rather than by value, so a later one may still be big enough. + refreshIdx++; + continue refreshIteration; } const withdrawDenoms = refreshDenoms[d.info.exchangeBaseUrl];