gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-wallet-core] 02/02: wallet-core: empty balance item for exchanges


From: gnunet
Subject: [taler-wallet-core] 02/02: wallet-core: empty balance item for exchanges that are used or have accepted ToS
Date: Wed, 27 Mar 2024 19:22:00 +0100

This is an automated email from the git hooks/post-receive script.

dold pushed a commit to branch master
in repository wallet-core.

commit be0f21389bb2c206344ed9c4f78c72ae84d5548d
Author: Florian Dold <florian@dold.me>
AuthorDate: Wed Mar 27 19:21:53 2024 +0100

    wallet-core: empty balance item for exchanges that are used or have 
accepted ToS
---
 packages/taler-wallet-core/src/balance.ts | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/packages/taler-wallet-core/src/balance.ts 
b/packages/taler-wallet-core/src/balance.ts
index 5e3562ba2..50996b8de 100644
--- a/packages/taler-wallet-core/src/balance.ts
+++ b/packages/taler-wallet-core/src/balance.ts
@@ -67,6 +67,7 @@ import {
 import { ExchangeRestrictionSpec, findMatchingWire } from "./coinSelection.js";
 import {
   DepositOperationStatus,
+  ExchangeEntryDbRecordStatus,
   OPERATION_STATUS_ACTIVE_FIRST,
   OPERATION_STATUS_ACTIVE_LAST,
   RefreshGroupRecord,
@@ -304,6 +305,18 @@ export async function getBalancesInsideTransaction(
     OPERATION_STATUS_ACTIVE_LAST,
   );
 
+  await tx.exchanges.iter().forEachAsync(async (ex) => {
+    if (
+      ex.entryStatus === ExchangeEntryDbRecordStatus.Used ||
+      ex.tosAcceptedTimestamp != null
+    ) {
+      const det = await getExchangeWireDetailsInTx(tx, ex.baseUrl);
+      if (det) {
+        await balanceStore.addZero(det.currency, ex.baseUrl);
+      }
+    }
+  });
+
   await tx.coinAvailability.iter().forEachAsync(async (ca) => {
     const count = ca.visibleCoinCount ?? 0;
     await balanceStore.addZero(ca.currency, ca.exchangeBaseUrl);

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]