diff options
author | Florian Dold <florian@dold.me> | 2022-09-19 12:48:11 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2022-09-19 12:48:11 +0200 |
commit | d34f8e48da519f0e35ec33ee9fd4aba5d95e1667 (patch) | |
tree | 4aba683496b20f49b915639b787fa439af3a7c11 /packages/taler-wallet-core/src/wallet.ts | |
parent | d759c7e78a2bbf8c0cf191aab7f513353372baf9 (diff) | |
download | wallet-core-d34f8e48da519f0e35ec33ee9fd4aba5d95e1667.tar.xz |
wallet-core: make coin availability accounting idempotent
Diffstat (limited to 'packages/taler-wallet-core/src/wallet.ts')
-rw-r--r-- | packages/taler-wallet-core/src/wallet.ts | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/packages/taler-wallet-core/src/wallet.ts b/packages/taler-wallet-core/src/wallet.ts index 0208f24ac..c615bc81d 100644 --- a/packages/taler-wallet-core/src/wallet.ts +++ b/packages/taler-wallet-core/src/wallet.ts @@ -810,6 +810,10 @@ export async function makeCoinAvailable( }>, coinRecord: CoinRecord, ): Promise<void> { + const existingCoin = await tx.coins.get(coinRecord.coinPub); + if (existingCoin) { + return; + } const denom = await tx.denominations.get([ coinRecord.exchangeBaseUrl, coinRecord.denomPubHash, |