commit 3830cf3476372f3299beaf018be030d3c990aee7
parent 6b4c5fccf44038daf3a66b13697fc6b716a480fa
Author: Florian Dold <dold@taler.net>
Date: Wed, 22 Jul 2026 15:44:04 +0200
wallet: report the restrictions that reject a wire account
findMatchingWire declared the map of rejecting restrictions and returned it,
but never wrote to it, so it was always empty and the branch consuming it was
unreachable. The maximum deposit amount now carries the restrictions on to
its response, where the field is already documented.
Diffstat:
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/packages/taler-wallet-core/src/coinSelection.ts b/packages/taler-wallet-core/src/coinSelection.ts
@@ -896,7 +896,6 @@ export function findMatchingWire(
let debitAccountCheckOk = false;
if (depositPaytoUri) {
- // FIXME: We should somehow propagate the hint here!
const checkResult = checkAccountRestriction(
depositPaytoUri,
acc.debit_restrictions,
@@ -909,6 +908,10 @@ export function findMatchingWire(
}
if (!debitAccountCheckOk) {
+ // Keep the restrictions that rejected the account, so that the caller
+ // can say why the exchange cannot be used. They carry the human
+ // readable hints.
+ accountRestrictions[acc.payto_uri] = acc.debit_restrictions;
continue;
}
@@ -1424,6 +1427,10 @@ function getMaxDepositAmountForAvailableCoins(
return {
effectiveAmount: Amounts.stringify(amountEffective),
rawAmount: Amounts.stringify(Amounts.sub(amountEffective, fees).amount),
+ ...(candidateRes.depositRestrictions != null &&
+ Object.keys(candidateRes.depositRestrictions).length > 0
+ ? { depositRestrictions: candidateRes.depositRestrictions }
+ : undefined),
};
}