diff options
author | Florian Dold <florian@dold.me> | 2023-12-18 23:00:33 +0100 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2023-12-18 23:00:33 +0100 |
commit | f22f5f89cc99fb0556b956b6432e4817d52378d2 (patch) | |
tree | 9998bd4fd0d2b51ba5c27ebe9c2f694134c93841 /packages/taler-wallet-core/src/wallet.ts | |
parent | 0ba8fe9428dc5779cc98bf4e875f60eb01966323 (diff) | |
download | wallet-core-f22f5f89cc99fb0556b956b6432e4817d52378d2.tar.xz |
wallet-core: update exchange inline, not in task
A task (such as refresh) can't wait until the exchange update task
updates the exchange, as task handlers don't run concurrently.
The previous behavior caused some transactions to block indefinitely
when waiting for an updated exchange entry.
Diffstat (limited to 'packages/taler-wallet-core/src/wallet.ts')
-rw-r--r-- | packages/taler-wallet-core/src/wallet.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/packages/taler-wallet-core/src/wallet.ts b/packages/taler-wallet-core/src/wallet.ts index da6ffa41f..2d422e59c 100644 --- a/packages/taler-wallet-core/src/wallet.ts +++ b/packages/taler-wallet-core/src/wallet.ts @@ -844,12 +844,12 @@ async function handlePrepareWithdrawExchange( } const exchangeBaseUrl = parsedUri.exchangeBaseUrl; const exchange = await fetchFreshExchange(ws, exchangeBaseUrl); - if (exchange.exchangeDetails.masterPublicKey != parsedUri.exchangePub) { + if (exchange.masterPub != parsedUri.exchangePub) { throw Error("mismatch of exchange master public key (URI vs actual)"); } if (parsedUri.amount) { const amt = Amounts.parseOrThrow(parsedUri.amount); - if (amt.currency !== exchange.exchangeDetails.currency) { + if (amt.currency !== exchange.currency) { throw Error("mismatch of currency (URI vs exchange)"); } } @@ -1689,7 +1689,7 @@ class InternalWalletStateImpl implements InternalWalletState { exchangeOps: ExchangeOperations = { getExchangeDetails, - updateExchangeFromUrl: fetchFreshExchange, + fetchFreshExchange, }; recoupOps: RecoupOperations = { |