diff options
author | Florian Dold <florian@dold.me> | 2022-09-14 20:34:37 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2022-09-14 20:40:38 +0200 |
commit | c021876b41bff11ad28c3a43808795fa0d02ce99 (patch) | |
tree | c92f4e83def462ddb0d446c9c476fd32f648d744 /packages/taler-wallet-core/src/operations/withdraw.ts | |
parent | 9d044058e267e9e94f3ee63809a1e22426151ee5 (diff) | |
download | wallet-core-c021876b41bff11ad28c3a43808795fa0d02ce99.tar.xz |
wallet-core: cache fresh coin count in DB
Diffstat (limited to 'packages/taler-wallet-core/src/operations/withdraw.ts')
-rw-r--r-- | packages/taler-wallet-core/src/operations/withdraw.ts | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/packages/taler-wallet-core/src/operations/withdraw.ts b/packages/taler-wallet-core/src/operations/withdraw.ts index 1b8383776..bee83265c 100644 --- a/packages/taler-wallet-core/src/operations/withdraw.ts +++ b/packages/taler-wallet-core/src/operations/withdraw.ts @@ -93,11 +93,11 @@ import { } from "../util/http.js"; import { checkDbInvariant, checkLogicInvariant } from "../util/invariants.js"; import { DbAccess, GetReadOnlyAccess } from "../util/query.js"; -import { RetryInfo } from "../util/retries.js"; import { WALLET_BANK_INTEGRATION_PROTOCOL_VERSION, WALLET_EXCHANGE_PROTOCOL_VERSION, } from "../versions.js"; +import { makeCoinAvailable } from "../wallet.js"; import { getExchangeDetails, getExchangePaytoUri, @@ -805,7 +805,6 @@ async function processPlanchetVerifyAndStoreCoin( reservePub: planchet.reservePub, withdrawalGroupId: withdrawalGroup.withdrawalGroupId, }, - suspended: false, ageCommitmentProof: planchet.ageCommitmentProof, }; @@ -815,7 +814,7 @@ async function processPlanchetVerifyAndStoreCoin( // withdrawal succeeded. If so, mark the withdrawal // group as finished. const firstSuccess = await ws.db - .mktx((x) => [x.coins, x.withdrawalGroups, x.planchets]) + .mktx((x) => [x.coins, x.denominations, x.withdrawalGroups, x.planchets]) .runReadWrite(async (tx) => { const p = await tx.planchets.get(planchetCoinPub); if (!p || p.withdrawalDone) { @@ -823,7 +822,7 @@ async function processPlanchetVerifyAndStoreCoin( } p.withdrawalDone = true; await tx.planchets.put(p); - await tx.coins.add(coin); + await makeCoinAvailable(ws, tx, coin); return true; }); |