diff options
Diffstat (limited to 'packages/taler-wallet-core/src/operations/refresh.ts')
-rw-r--r-- | packages/taler-wallet-core/src/operations/refresh.ts | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/packages/taler-wallet-core/src/operations/refresh.ts b/packages/taler-wallet-core/src/operations/refresh.ts index 3bbbc2a4b..5ea8fae23 100644 --- a/packages/taler-wallet-core/src/operations/refresh.ts +++ b/packages/taler-wallet-core/src/operations/refresh.ts @@ -99,11 +99,7 @@ import { TaskRunResult, TaskRunResultType, } from "./common.js"; -import { - fetchFreshExchange, - startUpdateExchangeEntry, - waitExchangeEntryUpdated, -} from "./exchanges.js"; +import { fetchFreshExchange } from "./exchanges.js"; import { constructTransactionIdentifier, notifyTransition, @@ -226,10 +222,7 @@ async function provideRefreshSession( const { refreshGroup, coin } = d; - const { exchange } = await fetchFreshExchange(ws, coin.exchangeBaseUrl); - if (!exchange) { - throw Error("db inconsistent: exchange of coin not found"); - } + const exch = await fetchFreshExchange(ws, coin.exchangeBaseUrl); // FIXME: use helper functions from withdraw.ts // to update and filter withdrawable denoms. @@ -240,7 +233,7 @@ async function provideRefreshSession( const oldDenom = await ws.getDenomInfo( ws, tx, - exchange.baseUrl, + exch.exchangeBaseUrl, coin.denomPubHash, ); @@ -251,7 +244,7 @@ async function provideRefreshSession( // FIXME: use an index here, based on the withdrawal expiration time. const availableDenoms: DenominationRecord[] = await tx.denominations.indexes.byExchangeBaseUrl - .iter(exchange.baseUrl) + .iter(exch.exchangeBaseUrl) .toArray(); const availableAmount = Amounts.sub( @@ -872,7 +865,7 @@ export async function processRefreshGroup( return TaskRunResult.finished(); } // Process refresh sessions of the group in parallel. - logger.trace("processing refresh sessions for old coins"); + logger.trace("processing refresh sessions for $ old coins"); let errors: TalerErrorDetail[] = []; let inShutdown = false; const ps = refreshGroup.oldCoinPubs.map((x, i) => |