aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/coinSelection.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2024-03-07 13:22:34 +0100
committerFlorian Dold <florian@dold.me>2024-03-07 13:22:44 +0100
commitb059cf4b16663ef2db70a2c2d7af0a6ba5ce2688 (patch)
tree08c0a4e5c8ab83264c6ba65ba4cfedb291fd8ed5 /packages/taler-wallet-core/src/coinSelection.ts
parente923ce6675b34259fd52f704bb502208df519cd6 (diff)
downloadwallet-core-b059cf4b16663ef2db70a2c2d7af0a6ba5ce2688.tar.xz
pass wire fees to coin selection, logging
Diffstat (limited to 'packages/taler-wallet-core/src/coinSelection.ts')
-rw-r--r--packages/taler-wallet-core/src/coinSelection.ts11
1 files changed, 11 insertions, 0 deletions
diff --git a/packages/taler-wallet-core/src/coinSelection.ts b/packages/taler-wallet-core/src/coinSelection.ts
index 50965fd6c..672d0ee79 100644
--- a/packages/taler-wallet-core/src/coinSelection.ts
+++ b/packages/taler-wallet-core/src/coinSelection.ts
@@ -185,6 +185,10 @@ export async function selectPayCoins(
): Promise<SelectPayCoinsResult> {
const { contractTermsAmount, depositFeeLimit, wireFeeLimit } = req;
+ if (logger.shouldLogTrace()) {
+ logger.trace(`selecting coins for ${j2s(req)}`);
+ }
+
return await wex.db.runReadOnlyTx(
[
"coinAvailability",
@@ -207,6 +211,8 @@ export async function selectPayCoins(
},
);
+ logger.trace(`wire fees per exchange: ${j2s(wireFeesPerExchange)}`);
+
const coinRes: SelectedCoin[] = [];
const currency = contractTermsAmount.currency;
@@ -274,6 +280,10 @@ export async function selectPayCoins(
tally,
);
+ if (logger.shouldLogTrace()) {
+ logger.trace(`coin selection: ${j2s(coinSel)}`);
+ }
+
return {
type: "success",
coinSel,
@@ -766,6 +776,7 @@ async function selectPayCandidates(
if (!wire) {
continue;
}
+ wfPerExchange[exchange.baseUrl] = wire.wireFee;
}
// 3. exchange is trusted in the exchange list or auditor list