commit dae0c9f8ac9a9102e7c933bc457eea06ca9bddce
parent 96c12ccd6340ab4aa3aa28156d10c64a0eeaed7f
Author: Florian Dold <florian@dold.me>
Date: Wed, 8 Jul 2026 20:46:50 +0200
wallet-core: fix (lack of) comparison in insufficient balance reporting
Diffstat:
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/packages/taler-wallet-core/src/coinSelection.ts b/packages/taler-wallet-core/src/coinSelection.ts
@@ -53,7 +53,6 @@ import {
ScopeInfo,
ScopeType,
SelectedCoin,
- SelectedProspectiveCoin,
strcmp,
TalerProtocolTimestamp,
} from "@gnu-taler/taler-util";
@@ -466,12 +465,12 @@ function getHint(
return InsufficientBalanceHint.AgeRestricted;
} else if (
isMerchant &&
- Amounts.cmp(exchDet.balanceReceiverAcceptable, req.instructedAmount)
+ Amounts.cmp(exchDet.balanceReceiverAcceptable, req.instructedAmount) < 0
) {
return InsufficientBalanceHint.MerchantAcceptInsufficient;
} else if (
isMerchant &&
- Amounts.cmp(exchDet.balanceExchangeDepositable, req.instructedAmount)
+ Amounts.cmp(exchDet.balanceExchangeDepositable, req.instructedAmount) < 0
) {
return InsufficientBalanceHint.MerchantDepositInsufficient;
} else if (