diff options
Diffstat (limited to 'packages/taler-wallet-core/src/wallet.ts')
-rw-r--r-- | packages/taler-wallet-core/src/wallet.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/packages/taler-wallet-core/src/wallet.ts b/packages/taler-wallet-core/src/wallet.ts index 2e362da6e..c91a96841 100644 --- a/packages/taler-wallet-core/src/wallet.ts +++ b/packages/taler-wallet-core/src/wallet.ts @@ -221,7 +221,7 @@ import { HttpRequestLibrary, readSuccessResponseJsonOrThrow, } from "./util/http.js"; -import { checkDbInvariant } from "./util/invariants.js"; +import { checkDbInvariant, checkLogicInvariant } from "./util/invariants.js"; import { AsyncCondition, OpenedPromise, @@ -812,6 +812,7 @@ export async function makeCoinAvailable( }>, coinRecord: CoinRecord, ): Promise<void> { + checkLogicInvariant(coinRecord.status === CoinStatus.Fresh); const existingCoin = await tx.coins.get(coinRecord.coinPub); if (existingCoin) { return; |