gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] branch master updated (b87ad626 -> e53e06bc)


From: gnunet
Subject: [taler-exchange] branch master updated (b87ad626 -> e53e06bc)
Date: Wed, 22 Nov 2023 23:34:29 +0100

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

grothoff pushed a change to branch master
in repository exchange.

    from b87ad626 -fix minor threading issue
     new a7f78756 -fix minor threading issue
     new e53e06bc avoid race on serial_counter by deferring access to 
serial_counter after the parsing function is done and we have the lock

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/bank-lib/fakebank_common_parser.c   | 2 +-
 src/bank-lib/fakebank_tbr_get_history.c | 2 ++
 src/bank-lib/fakebank_twg_history.c     | 8 +++++++-
 3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/bank-lib/fakebank_common_parser.c 
b/src/bank-lib/fakebank_common_parser.c
index 98b8d609..cf2dc5a7 100644
--- a/src/bank-lib/fakebank_common_parser.c
+++ b/src/bank-lib/fakebank_common_parser.c
@@ -112,7 +112,7 @@ TALER_FAKEBANK_common_parse_history_args (
            : GNUNET_SYSERR;
   }
   if (NULL == start)
-    ha->start_idx = (d > 0) ? 0 : h->serial_counter;
+    ha->start_idx = (d > 0) ? 0 : UINT64_MAX;
   else
     ha->start_idx = (uint64_t) sval;
   ha->delta = (int64_t) d;
diff --git a/src/bank-lib/fakebank_tbr_get_history.c 
b/src/bank-lib/fakebank_tbr_get_history.c
index 7e7f9dda..e81e0089 100644
--- a/src/bank-lib/fakebank_tbr_get_history.c
+++ b/src/bank-lib/fakebank_tbr_get_history.c
@@ -84,6 +84,8 @@ TALER_FAKEBANK_tbr_get_history_incoming (
     }
     GNUNET_assert (0 ==
                    pthread_mutex_lock (&h->big_lock));
+    if (UINT64_MAX == hc->ha.start_idx)
+      hc->ha.start_idx = h->serial_counter;
     hc->acc = TALER_FAKEBANK_lookup_account_ (h,
                                               account,
                                               NULL);
diff --git a/src/bank-lib/fakebank_twg_history.c 
b/src/bank-lib/fakebank_twg_history.c
index c75b5c88..1d70ed12 100644
--- a/src/bank-lib/fakebank_twg_history.c
+++ b/src/bank-lib/fakebank_twg_history.c
@@ -59,6 +59,7 @@ TALER_FAKEBANK_twg_get_debit_history_ (
   struct Transaction *pos;
   enum GNUNET_GenericReturnValue ret;
   bool in_shutdown;
+  const char *acc_payto_uri;
 
   if (NULL == cc)
   {
@@ -81,6 +82,8 @@ TALER_FAKEBANK_twg_get_debit_history_ (
     }
     GNUNET_assert (0 ==
                    pthread_mutex_lock (&h->big_lock));
+    if (UINT64_MAX == hc->ha.start_idx)
+      hc->ha.start_idx = h->serial_counter;
     hc->acc = TALER_FAKEBANK_lookup_account_ (h,
                                               account,
                                               NULL);
@@ -266,6 +269,7 @@ TALER_FAKEBANK_twg_get_debit_history_ (
     return MHD_YES;
   }
   in_shutdown = h->in_shutdown;
+  acc_payto_uri = hc->acc->payto_uri;
   GNUNET_assert (0 ==
                  pthread_mutex_unlock (&h->big_lock));
 finish:
@@ -288,7 +292,7 @@ finish:
       MHD_HTTP_OK,
       GNUNET_JSON_pack_string (
         "debit_account",
-        hc->acc->payto_uri),
+        acc_payto_uri),
       GNUNET_JSON_pack_array_steal (
         "outgoing_transactions",
         h));
@@ -331,6 +335,8 @@ TALER_FAKEBANK_twg_get_credit_history_ (
     }
     GNUNET_assert (0 ==
                    pthread_mutex_lock (&h->big_lock));
+    if (UINT64_MAX == hc->ha.start_idx)
+      hc->ha.start_idx = h->serial_counter;
     hc->acc = TALER_FAKEBANK_lookup_account_ (h,
                                               account,
                                               NULL);

-- 
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]