gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] branch master updated: remove unnecessary operations fr


From: gnunet
Subject: [taler-exchange] branch master updated: remove unnecessary operations from global lock scope
Date: Thu, 07 Mar 2024 10:53:31 +0100

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 b92034e1 remove unnecessary operations from global lock scope
b92034e1 is described below

commit b92034e1a934e545f0d9967cf1ebba85f88fa51f
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Thu Mar 7 10:53:29 2024 +0100

    remove unnecessary operations from global lock scope
---
 src/bank-lib/fakebank_tbr_get_history.c | 17 +++++++----------
 src/bank-lib/fakebank_twg_history.c     | 17 +++++++----------
 2 files changed, 14 insertions(+), 20 deletions(-)

diff --git a/src/bank-lib/fakebank_tbr_get_history.c 
b/src/bank-lib/fakebank_tbr_get_history.c
index e318a2af..a6cfaad8 100644
--- a/src/bank-lib/fakebank_tbr_get_history.c
+++ b/src/bank-lib/fakebank_tbr_get_history.c
@@ -70,7 +70,12 @@ TALER_FAKEBANK_tbr_get_history (
     *con_cls = cc;
     hc = GNUNET_new (struct HistoryContext);
     cc->ctx = hc;
-
+    hc->history = json_array ();
+    if (NULL == hc->history)
+    {
+      GNUNET_break (0);
+      return MHD_NO;
+    }
     GNUNET_log (GNUNET_ERROR_TYPE_INFO,
                 "Handling /accounts/%s/taler-revenue/history request\n",
                 account);
@@ -82,6 +87,7 @@ TALER_FAKEBANK_tbr_get_history (
       GNUNET_break_op (0);
       return (GNUNET_SYSERR == ret) ? MHD_NO : MHD_YES;
     }
+    hc->timeout = GNUNET_TIME_relative_to_absolute (hc->ha.lp_timeout);
     GNUNET_assert (0 ==
                    pthread_mutex_lock (&h->big_lock));
     if (UINT64_MAX == hc->ha.start_idx)
@@ -101,15 +107,6 @@ TALER_FAKEBANK_tbr_get_history (
                                          TALER_EC_BANK_UNKNOWN_ACCOUNT,
                                          account);
     }
-    hc->history = json_array ();
-    if (NULL == hc->history)
-    {
-      GNUNET_break (0);
-      GNUNET_assert (0 ==
-                     pthread_mutex_unlock (&h->big_lock));
-      return MHD_NO;
-    }
-    hc->timeout = GNUNET_TIME_relative_to_absolute (hc->ha.lp_timeout);
   }
   else
   {
diff --git a/src/bank-lib/fakebank_twg_history.c 
b/src/bank-lib/fakebank_twg_history.c
index c10358c1..6d3c376e 100644
--- a/src/bank-lib/fakebank_twg_history.c
+++ b/src/bank-lib/fakebank_twg_history.c
@@ -325,7 +325,12 @@ TALER_FAKEBANK_twg_get_credit_history_ (
     *con_cls = cc;
     hc = GNUNET_new (struct HistoryContext);
     cc->ctx = hc;
-
+    hc->history = json_array ();
+    if (NULL == hc->history)
+    {
+      GNUNET_break (0);
+      return MHD_NO;
+    }
     GNUNET_log (GNUNET_ERROR_TYPE_INFO,
                 "Handling /history/incoming connection %p\n",
                 connection);
@@ -337,6 +342,7 @@ TALER_FAKEBANK_twg_get_credit_history_ (
       GNUNET_break_op (0);
       return (GNUNET_SYSERR == ret) ? MHD_NO : MHD_YES;
     }
+    hc->timeout = GNUNET_TIME_relative_to_absolute (hc->ha.lp_timeout);
     GNUNET_assert (0 ==
                    pthread_mutex_lock (&h->big_lock));
     if (UINT64_MAX == hc->ha.start_idx)
@@ -353,15 +359,6 @@ TALER_FAKEBANK_twg_get_credit_history_ (
                                          TALER_EC_BANK_UNKNOWN_ACCOUNT,
                                          account);
     }
-    hc->history = json_array ();
-    if (NULL == hc->history)
-    {
-      GNUNET_break (0);
-      GNUNET_assert (0 ==
-                     pthread_mutex_unlock (&h->big_lock));
-      return MHD_NO;
-    }
-    hc->timeout = GNUNET_TIME_relative_to_absolute (hc->ha.lp_timeout);
   }
   else
   {

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