aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-wallet-core')
-rw-r--r--packages/taler-wallet-core/src/util/coinSelection.ts20
1 files changed, 10 insertions, 10 deletions
diff --git a/packages/taler-wallet-core/src/util/coinSelection.ts b/packages/taler-wallet-core/src/util/coinSelection.ts
index f24184609..6070f4c78 100644
--- a/packages/taler-wallet-core/src/util/coinSelection.ts
+++ b/packages/taler-wallet-core/src/util/coinSelection.ts
@@ -233,9 +233,9 @@ function tallyFees(
export type SelectPayCoinsResult =
| {
- type: "failure";
- insufficientBalanceDetails: PayMerchantInsufficientBalanceDetails;
- }
+ type: "failure";
+ insufficientBalanceDetails: PayMerchantInsufficientBalanceDetails;
+ }
| { type: "success"; coinSel: PayCoinSelection };
/**
@@ -614,7 +614,7 @@ async function selectPayMerchantCandidates(
const denoms: AvailableDenom[] = [];
const exchanges = await tx.exchanges.iter().toArray();
const wfPerExchange: Record<string, AmountJson> = {};
- for (const exchange of exchanges) {
+ loopExchange: for (const exchange of exchanges) {
const exchangeDetails = await getExchangeWireDetailsInTx(
tx,
exchange.baseUrl,
@@ -625,7 +625,7 @@ async function selectPayMerchantCandidates(
}
let wireMethodFee: string | undefined;
// 2.- exchange supports wire method
- for (const acc of exchangeDetails.wireInfo.accounts) {
+ loopWireAccount: for (const acc of exchangeDetails.wireInfo.accounts) {
const pp = parsePaytoUri(acc.payto_uri);
checkLogicInvariant(!!pp);
if (pp.targetType !== req.wireMethod) {
@@ -656,11 +656,11 @@ async function selectPayMerchantCandidates(
if (wireFeeStr) {
wireMethodFee = wireFeeStr;
+ break loopWireAccount;
}
- break;
}
if (!wireMethodFee) {
- break;
+ continue;
}
wfPerExchange[exchange.baseUrl] = Amounts.parseOrThrow(wireMethodFee);
@@ -889,9 +889,9 @@ export interface PeerCoinSelectionDetails {
export type SelectPeerCoinsResult =
| { type: "success"; result: PeerCoinSelectionDetails }
| {
- type: "failure";
- insufficientBalanceDetails: PayPeerInsufficientBalanceDetails;
- };
+ type: "failure";
+ insufficientBalanceDetails: PayPeerInsufficientBalanceDetails;
+ };
export interface PeerCoinRepair {
exchangeBaseUrl: string;