From 3ed118e5320df907287b3bd0d7aadda5b4e7913f Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Tue, 9 Apr 2024 18:43:30 +0200 Subject: wallet-core: extra cancellation points --- packages/taler-wallet-core/src/withdraw.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/taler-wallet-core/src/withdraw.ts b/packages/taler-wallet-core/src/withdraw.ts index a16a03054..ecd654edf 100644 --- a/packages/taler-wallet-core/src/withdraw.ts +++ b/packages/taler-wallet-core/src/withdraw.ts @@ -1937,6 +1937,8 @@ export async function getExchangeWithdrawalInfo( cancellationToken: wex.cancellationToken, }); + wex.cancellationToken.throwIfCancelled(); + if (exchange.currency != instructedAmount.currency) { // Specifying the amount in the conversion input currency is not yet supported. // We might add support for it later. @@ -1957,12 +1959,17 @@ export async function getExchangeWithdrawalInfo( logger.trace("updating withdrawal denoms"); await updateWithdrawalDenoms(wex, exchangeBaseUrl); + wex.cancellationToken.throwIfCancelled(); + logger.trace("getting candidate denoms"); const candidateDenoms = await getCandidateWithdrawalDenoms( wex, exchangeBaseUrl, instructedAmount.currency, ); + + wex.cancellationToken.throwIfCancelled(); + logger.trace("selecting withdrawal denoms"); // FIXME: Why not in a transaction? const selectedDenoms = selectWithdrawalDenominations( -- cgit v1.2.3