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/tip.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/tip.ts')
-rw-r--r-- | packages/taler-wallet-core/src/operations/tip.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/packages/taler-wallet-core/src/operations/tip.ts b/packages/taler-wallet-core/src/operations/tip.ts index 04da2b988..f70e2d02b 100644 --- a/packages/taler-wallet-core/src/operations/tip.ts +++ b/packages/taler-wallet-core/src/operations/tip.ts @@ -51,6 +51,7 @@ import { readSuccessResponseJsonOrThrow, } from "../util/http.js"; import { checkDbInvariant, checkLogicInvariant } from "../util/invariants.js"; +import { makeCoinAvailable } from "../wallet.js"; import { updateExchangeFromUrl } from "./exchanges.js"; import { getCandidateWithdrawalDenoms, @@ -310,13 +311,12 @@ export async function processTip( denomSig: { cipher: DenomKeyType.Rsa, rsa_signature: denomSigRsa.sig }, exchangeBaseUrl: tipRecord.exchangeBaseUrl, status: CoinStatus.Fresh, - suspended: false, coinEvHash: planchet.coinEvHash, }); } await ws.db - .mktx((x) => [x.coins, x.tips, x.withdrawalGroups]) + .mktx((x) => [x.coins, x.denominations, x.tips]) .runReadWrite(async (tx) => { const tr = await tx.tips.get(walletTipId); if (!tr) { @@ -328,7 +328,7 @@ export async function processTip( tr.pickedUpTimestamp = TalerProtocolTimestamp.now(); await tx.tips.put(tr); for (const cr of newCoinRecords) { - await tx.coins.put(cr); + await makeCoinAvailable(ws, tx, cr); } }); |