diff options
author | Florian Dold <florian@dold.me> | 2024-03-07 13:22:34 +0100 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2024-03-07 13:22:44 +0100 |
commit | b059cf4b16663ef2db70a2c2d7af0a6ba5ce2688 (patch) | |
tree | 08c0a4e5c8ab83264c6ba65ba4cfedb291fd8ed5 /packages/taler-wallet-core/src | |
parent | e923ce6675b34259fd52f704bb502208df519cd6 (diff) | |
download | wallet-core-b059cf4b16663ef2db70a2c2d7af0a6ba5ce2688.tar.xz |
pass wire fees to coin selection, logging
Diffstat (limited to 'packages/taler-wallet-core/src')
-rw-r--r-- | packages/taler-wallet-core/src/coinSelection.ts | 11 | ||||
-rw-r--r-- | packages/taler-wallet-core/src/host-impl.node.ts | 6 |
2 files changed, 15 insertions, 2 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 diff --git a/packages/taler-wallet-core/src/host-impl.node.ts b/packages/taler-wallet-core/src/host-impl.node.ts index 6a32a086a..ec026b296 100644 --- a/packages/taler-wallet-core/src/host-impl.node.ts +++ b/packages/taler-wallet-core/src/host-impl.node.ts @@ -110,8 +110,10 @@ async function makeSqliteDb( ): Promise<MakeDbResult> { BridgeIDBFactory.enableTracing = false; const imp = await createNodeSqlite3Impl(); + const dbFilename = args.persistentStoragePath ?? ":memory:"; + logger.info(`using database ${dbFilename}`); const myBackend = await createSqliteBackend(imp, { - filename: args.persistentStoragePath ?? ":memory:", + filename: dbFilename, }); myBackend.enableTracing = false; if (process.env.TALER_WALLET_DBSTATS) { @@ -159,7 +161,7 @@ export async function createNativeWalletHost2( logger.info("using JSON file DB backend (slow, only use for testing)"); dbResp = await makeFileDb(args); } else { - logger.info("using sqlite3 DB backend"); + logger.info(`using sqlite3 DB backend`); dbResp = await makeSqliteDb(args); } |