taler-typescript-core

Wallet core logic and WebUIs for various components
Log | Files | Refs | Submodules | README | LICENSE

commit 3ed118e5320df907287b3bd0d7aadda5b4e7913f
parent 4527e33d7beec4fbb8f1a40ee5ce8d1fd2451a35
Author: Florian Dold <florian@dold.me>
Date:   Tue,  9 Apr 2024 18:43:30 +0200

wallet-core: extra cancellation points

Diffstat:
Mpackages/taler-wallet-core/src/withdraw.ts | 7+++++++
1 file changed, 7 insertions(+), 0 deletions(-)

diff --git 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(