gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] branch master updated: fix invariant check


From: gnunet
Subject: [taler-exchange] branch master updated: fix invariant check
Date: Fri, 24 Apr 2020 00:52:35 +0200

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

grothoff pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new 67720373 fix invariant check
67720373 is described below

commit 6772037321c96aed73e898e3328286c219bcf7c8
Author: Christian Grothoff <address@hidden>
AuthorDate: Fri Apr 24 00:52:33 2020 +0200

    fix invariant check
---
 src/exchangedb/exchangedb_transactions.c    | 9 +++++----
 src/exchangedb/plugin_exchangedb_postgres.c | 9 +++++----
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/src/exchangedb/exchangedb_transactions.c 
b/src/exchangedb/exchangedb_transactions.c
index 93e4104e..c1723958 100644
--- a/src/exchangedb/exchangedb_transactions.c
+++ b/src/exchangedb/exchangedb_transactions.c
@@ -42,13 +42,13 @@ TALER_EXCHANGEDB_calculate_transaction_list_totals (
   struct TALER_Amount refunded;
   struct TALER_Amount deposit_fee;
   bool have_refund;
-  bool have_deposit;
+  bool have_deposit_or_melt;
 
   GNUNET_assert (GNUNET_OK ==
                  TALER_amount_get_zero (spent.currency,
                                         &refunded));
   have_refund = false;
-  have_deposit = false;
+  have_deposit_or_melt = false;
   for (struct TALER_EXCHANGEDB_TransactionList *pos = tl;
        NULL != pos;
        pos = pos->next)
@@ -57,7 +57,7 @@ TALER_EXCHANGEDB_calculate_transaction_list_totals (
     {
     case TALER_EXCHANGEDB_TT_DEPOSIT:
       /* spent += pos->amount_with_fee */
-      have_deposit = true;
+      have_deposit_or_melt = true;
       if (0 >
           TALER_amount_add (&spent,
                             &spent,
@@ -70,6 +70,7 @@ TALER_EXCHANGEDB_calculate_transaction_list_totals (
       break;
     case TALER_EXCHANGEDB_TT_MELT:
       /* spent += pos->amount_with_fee */
+      have_deposit_or_melt = true;
       if (0 >
           TALER_amount_add (&spent,
                             &spent,
@@ -155,7 +156,7 @@ TALER_EXCHANGEDB_calculate_transaction_list_totals (
     GNUNET_break (0);
     return GNUNET_SYSERR;
   }
-  GNUNET_break (have_deposit);
+  GNUNET_break (have_deposit_or_melt);
   *ret = spent;
   return GNUNET_OK;
 }
diff --git a/src/exchangedb/plugin_exchangedb_postgres.c 
b/src/exchangedb/plugin_exchangedb_postgres.c
index e517d069..5bd674b2 100644
--- a/src/exchangedb/plugin_exchangedb_postgres.c
+++ b/src/exchangedb/plugin_exchangedb_postgres.c
@@ -4006,9 +4006,9 @@ struct CoinHistoryContext
   bool failed;
 
   /**
-   * Set to 'true' if we found a deposit (for invariant check).
+   * Set to 'true' if we found a deposit or melt (for invariant check).
    */
-  bool have_deposit;
+  bool have_deposit_or_melt;
 };
 
 
@@ -4034,7 +4034,7 @@ add_coin_deposit (void *cls,
     struct TALER_EXCHANGEDB_TransactionList *tl;
     uint64_t serial_id;
 
-    chc->have_deposit = true;
+    chc->have_deposit_or_melt = true;
     deposit = GNUNET_new (struct TALER_EXCHANGEDB_DepositListEntry);
     {
       struct GNUNET_PQ_ResultSpec rs[] = {
@@ -4106,6 +4106,7 @@ add_coin_melt (void *cls,
     struct TALER_EXCHANGEDB_TransactionList *tl;
     uint64_t serial_id;
 
+    chc->have_deposit_or_melt = true;
     melt = GNUNET_new (struct TALER_EXCHANGEDB_MeltListEntry);
     {
       struct GNUNET_PQ_ResultSpec rs[] = {
@@ -4512,7 +4513,7 @@ postgres_get_coin_transactions (
   *tlp = chc.head;
   if (NULL == chc.head)
     return GNUNET_DB_STATUS_SUCCESS_NO_RESULTS;
-  GNUNET_break (chc.have_deposit);
+  GNUNET_break (chc.have_deposit_or_melt);
   return GNUNET_DB_STATUS_SUCCESS_ONE_RESULT;
 }
 

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

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