taler-typescript-core

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

commit ffc5c64b22ea520d1fc057469a878b7b8db683d0
parent 6ea2da4bdffade9a9404f071c68f16546b38fc09
Author: Florian Dold <dold@taler.net>
Date:   Wed, 22 Jul 2026 10:40:52 +0200

wallet: require the balance to exceed a KYC threshold

The thresholds from wallet_balance_limit_without_kyc are crossed only once the
balance goes beyond them, so a balance equal to a threshold was reported as a
violation.

Diffstat:
Mpackages/taler-wallet-core/src/exchanges.ts | 6++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/packages/taler-wallet-core/src/exchanges.ts b/packages/taler-wallet-core/src/exchanges.ts @@ -3461,11 +3461,13 @@ export async function checkIncomingAmountLegalUnderKycBalanceThreshold( limits.sort((a, b) => Amounts.cmp(a, b)); logger.trace(`applicable limits: ${j2s(limits)}`); let limViolated: AmountString | undefined = undefined; + // A threshold is only crossed once the balance exceeds it, reaching it + // exactly is still allowed. for (let i = 0; i < limits.length; i++) { - if (Amounts.cmp(limits[i], balExpected) <= 0) { + if (Amounts.cmp(limits[i], balExpected) < 0) { limViolated = limits[i]; const limNext = limits[i + 1]; - if (limNext == null || Amounts.cmp(limNext, balExpected) > 0) { + if (limNext == null || Amounts.cmp(limNext, balExpected) >= 0) { break; } }