aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/db.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-wallet-core/src/db.ts')
-rw-r--r--packages/taler-wallet-core/src/db.ts15
1 files changed, 12 insertions, 3 deletions
diff --git a/packages/taler-wallet-core/src/db.ts b/packages/taler-wallet-core/src/db.ts
index 89bb8b053..c12d0f2f7 100644
--- a/packages/taler-wallet-core/src/db.ts
+++ b/packages/taler-wallet-core/src/db.ts
@@ -2152,10 +2152,8 @@ export interface CoinAvailabilityRecord {
* Number of fresh coins that are available
* and visible, i.e. the source transaction is in
* a final state.
- *
- * (Optional for backwards compatibility, defaults to 0.)
*/
- visibleCoinCount?: number;
+ visibleCoinCount: number;
}
export interface ContractTermsRecord {
@@ -2942,6 +2940,17 @@ export const walletDbFixups: FixupDescription[] = [
});
},
},
+ {
+ name: "CoinAvailabilityRecord_visibleCoinCount_add",
+ async fn(tx): Promise<void> {
+ await tx.coinAvailability.iter().forEachAsync(async (r) => {
+ if (r.visibleCoinCount == null) {
+ r.visibleCoinCount = r.freshCoinCount;
+ await tx.coinAvailability.put(r);
+ }
+ });
+ },
+ },
];
const logger = new Logger("db.ts");