gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] branch master updated: address FIXME: pass session when


From: gnunet
Subject: [taler-exchange] branch master updated: address FIXME: pass session when iterating over denominations
Date: Tue, 22 Dec 2020 18:15:27 +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 a644355c address FIXME: pass session when iterating over denominations
a644355c is described below

commit a644355c44ec08c6e0691c8e308bba69619fdccd
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Tue Dec 22 18:13:46 2020 +0100

    address FIXME: pass session when iterating over denominations
---
 src/auditor/report-lib.c                    | 10 +++++-----
 src/exchangedb/plugin_exchangedb_postgres.c |  6 ++++--
 src/include/taler_exchangedb_plugin.h       |  2 ++
 3 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/src/auditor/report-lib.c b/src/auditor/report-lib.c
index 19a8ed7d..e7d20dc5 100644
--- a/src/auditor/report-lib.c
+++ b/src/auditor/report-lib.c
@@ -164,10 +164,10 @@ TALER_ARL_report (json_t *array,
  * @param validity issuing information with value, fees and other info about 
the denomination.
  */
 static void
-add_denomination (void *cls,
-                  const struct TALER_DenominationPublicKey *denom_pub,
-                  const struct
-                  TALER_EXCHANGEDB_DenominationKeyInformationP *validity)
+add_denomination (
+  void *cls,
+  const struct TALER_DenominationPublicKey *denom_pub,
+  const struct TALER_EXCHANGEDB_DenominationKeyInformationP *validity)
 {
   const struct TALER_DenominationKeyValidityPS *issue = &validity->properties;
 
@@ -292,7 +292,7 @@ TALER_ARL_get_denomination_info_by_hash (
     denominations = GNUNET_CONTAINER_multihashmap_create (256,
                                                           GNUNET_NO);
     qs = TALER_ARL_edb->iterate_denomination_info (TALER_ARL_edb->cls,
-                                                   // FIXME: change API to 
pass session!?
+                                                   TALER_ARL_esession,
                                                    &add_denomination,
                                                    NULL);
     if (0 > qs)
diff --git a/src/exchangedb/plugin_exchangedb_postgres.c 
b/src/exchangedb/plugin_exchangedb_postgres.c
index bc3b292a..43b927c2 100644
--- a/src/exchangedb/plugin_exchangedb_postgres.c
+++ b/src/exchangedb/plugin_exchangedb_postgres.c
@@ -2004,12 +2004,14 @@ domination_cb_helper (void *cls,
  * Fetch information about all known denomination keys.
  *
  * @param cls the @e cls of this struct with the plugin-specific state
+ * @param session connection to use
  * @param cb function to call on each denomination key
  * @param cb_cls closure for @a cb
  * @return transaction status code
  */
 static enum GNUNET_DB_QueryStatus
 postgres_iterate_denomination_info (void *cls,
+                                    struct TALER_EXCHANGEDB_Session *session,
                                     TALER_EXCHANGEDB_DenominationCallback cb,
                                     void *cb_cls)
 {
@@ -2022,9 +2024,9 @@ postgres_iterate_denomination_info (void *cls,
     .cb_cls = cb_cls,
     .pg = pc
   };
-  struct TALER_EXCHANGEDB_Session *session;
 
-  session = postgres_get_session (pc);
+  if (NULL == session)
+    session = postgres_get_session (pc);
   if (NULL == session)
     return GNUNET_DB_STATUS_HARD_ERROR;
   return GNUNET_PQ_eval_prepared_multi_select (session->conn,
diff --git a/src/include/taler_exchangedb_plugin.h 
b/src/include/taler_exchangedb_plugin.h
index 869eebb5..068d97fb 100644
--- a/src/include/taler_exchangedb_plugin.h
+++ b/src/include/taler_exchangedb_plugin.h
@@ -1904,12 +1904,14 @@ struct TALER_EXCHANGEDB_Plugin
    * own read-only transaction (hence no session provided).
    *
    * @param cls the @e cls of this struct with the plugin-specific state
+   * @param session session to use
    * @param cb function to call on each denomination key
    * @param cb_cls closure for @a cb
    * @return transaction status code
    */
   enum GNUNET_DB_QueryStatus
   (*iterate_denomination_info)(void *cls,
+                               struct TALER_EXCHANGEDB_Session *session,
                                TALER_EXCHANGEDB_DenominationCallback cb,
                                void *cb_cls);
 

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