gnunet-svn
[Top][All Lists]
Advanced

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

[taler-donau] branch master updated: pg_iterate_donation_units adjustmen


From: gnunet
Subject: [taler-donau] branch master updated: pg_iterate_donation_units adjustment
Date: Fri, 29 Mar 2024 18:15:10 +0100

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

johannes-casaburi pushed a commit to branch master
in repository donau.

The following commit(s) were added to refs/heads/master by this push:
     new faaf0dc  pg_iterate_donation_units adjustment
faaf0dc is described below

commit faaf0dc757e0cc5589b1bdb15d73e457af0a533e
Author: Casaburi Johannes <johannes.casaburi@students.bfh.ch>
AuthorDate: Fri Mar 29 18:12:47 2024 +0100

    pg_iterate_donation_units adjustment
---
 src/donau/donau-httpd_keys.c            | 50 ++++++++++-----------------------
 src/donaudb/pg_iterate_donation_units.c | 34 ++++++++--------------
 2 files changed, 26 insertions(+), 58 deletions(-)

diff --git a/src/donau/donau-httpd_keys.c b/src/donau/donau-httpd_keys.c
index 4a8275b..44bc174 100644
--- a/src/donau/donau-httpd_keys.c
+++ b/src/donau/donau-httpd_keys.c
@@ -991,9 +991,11 @@ destroy_key_state (struct DH_KeyStateHandle *ksh,
   clear_response_cache (ksh);
 
   GNUNET_CONTAINER_multihashmap_iterate (ksh->donation_unit_map,
-                                         &clear_donation_unit_cb, ksh);
+                                         &clear_donation_unit_cb,
+                                         ksh);
   GNUNET_CONTAINER_multihashmap_destroy (ksh->donation_unit_map);
-  GNUNET_CONTAINER_multipeermap_iterate (ksh->signkey_map, &clear_signkey_cb,
+  GNUNET_CONTAINER_multipeermap_iterate (ksh->signkey_map,
+                                         &clear_signkey_cb,
                                          ksh);
   GNUNET_CONTAINER_multipeermap_destroy (ksh->signkey_map);
 
@@ -1108,13 +1110,15 @@ helper_rsa_cb (
       &hd->h_donation_unit_pub.hash,
       hd,
       GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY));
+
   // GNUNET_assert (
   //   GNUNET_OK ==
   //   GNUNET_CONTAINER_multihashmap_put (
   //     hs->rsa_keys,
-  //     &hd->h_details.h_rsa.hash,
+  //     &hd->h_donation_unit_pub.h_rsa.hash,
   //     hd,
   //     GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY));
+
   key_generation++;
   DH_resume_keys_requests (false);
 }
@@ -1214,13 +1218,15 @@ helper_cs_cb (
       &hd->h_donation_unit_pub.hash,
       hd,
       GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY));
+
   // GNUNET_assert (
   //   GNUNET_OK ==
   //   GNUNET_CONTAINER_multihashmap_put (
   //     hs->cs_keys,
-  //     &hd->h_details.h_cs.hash,
+  //     &hd->h_donation_unit_pub.h_cs.hash,
   //     hd,
   //     GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY));
+
   key_generation++;
   DH_resume_keys_requests (false);
 }
@@ -1387,37 +1393,10 @@ donation_unit_info_cb (
 {
   struct DH_KeyStateHandle *ksh = cls;
   struct DH_DonationUnitKey *dk;
-//
-// if (GNUNET_OK !=
-//    TALER_donau_offline_donation_unit_validity_verify (
-//      h_donation_unit_pub,
-//      meta->start,
-//      meta->expire_withdraw,
-//      meta->expire_deposit,
-//      meta->expire_legal,
-//      &meta->value,
-//      &meta->fees,
-//      &TEH_master_public_key,
-//      master_sig))
-// {
-//  GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//              "Database has donation_unit with invalid signature. Skipping 
entry. Did the donau offline public key change?\n");
-//  return;
-// }
-
-  GNUNET_assert (GNUNET_CRYPTO_BSA_INVALID !=
-                 donation_unit_pub->bsign_pub_key->cipher);
-
-  // if (GNUNET_TIME_absolute_is_zero (meta->start.abs_time) ||
-  //    GNUNET_TIME_absolute_is_zero (meta->expire_withdraw.abs_time) ||
-  //    GNUNET_TIME_absolute_is_zero (meta->expire_deposit.abs_time) ||
-  //    GNUNET_TIME_absolute_is_zero (meta->expire_legal.abs_time) )
-  // {
-  //  GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-  //              "Database contains invalid donation_unit key %s\n",
-  //              GNUNET_h2s (&h_donation_unit_pub->hash));
-  //  return;
-  // }
+
+  // GNUNET_assert (GNUNET_CRYPTO_BSA_INVALID !=
+  //                donation_unit_pub->bsign_pub_key->cipher);
+
   dk = GNUNET_new (struct DH_DonationUnitKey);
   DONAU_donation_unit_pub_deep_copy (&dk->donation_unit_pub,
                                      donation_unit_pub);
@@ -1480,6 +1459,7 @@ build_key_state (struct HelperState *hs)
   enum GNUNET_DB_QueryStatus qs;
 
   ksh = GNUNET_new (struct DH_KeyStateHandle);
+
   ksh->signature_expires = GNUNET_TIME_UNIT_FOREVER_TS;
   ksh->reload_time = GNUNET_TIME_timestamp_get ();
   /* We must use the key_generation from when we STARTED the process! */
diff --git a/src/donaudb/pg_iterate_donation_units.c 
b/src/donaudb/pg_iterate_donation_units.c
index f227c5e..facda26 100644
--- a/src/donaudb/pg_iterate_donation_units.c
+++ b/src/donaudb/pg_iterate_donation_units.c
@@ -46,11 +46,6 @@ struct IterateDonationUnitsContext
    */
   struct PostgresClosure *pg;
 
-  /**
-   * Flag set to #GNUNET_OK as long as everything is fine.
-   */
-  enum GNUNET_DB_QueryStatus qs;
-
 };
 
 /**
@@ -93,18 +88,15 @@ iterate_donation_units_cb (void *cls,
                                   i))
     {
       GNUNET_break (0);
-      ctx->qs = GNUNET_DB_STATUS_HARD_ERROR;
       return;
     }
 
-    ctx->qs = i + 1;
-    if (GNUNET_OK !=
-        ctx->cb (ctx->cb_cls,
-                 &h_donation_unit_pub,
-                 &donation_unit_pub,
-                 validity_year,
-                 &value))
-      break;
+    ctx->cb (ctx->cb_cls,
+             &h_donation_unit_pub,
+             &donation_unit_pub,
+             validity_year,
+             &value);
+    GNUNET_PQ_cleanup_result (rs);
   }
 }
 
@@ -123,7 +115,6 @@ DH_PG_iterate_donation_units (void *cls,
     .cb_cls = cb_cls,
     .pg = pg
   };
-  enum GNUNET_DB_QueryStatus qs;
 
   PREPARE (pg,
            "iterate_donation_units",
@@ -133,12 +124,9 @@ DH_PG_iterate_donation_units (void *cls,
            ",validity_year"
            ",value"
            " FROM donation_units");
-  qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn,
-                                             "iterate_donation_units",
-                                             params,
-                                             &iterate_donation_units_cb,
-                                             &ctx);
-  if (qs <= 0)
-    return qs;
-  return ctx.qs;
+  return GNUNET_PQ_eval_prepared_multi_select (pg->conn,
+                                               "iterate_donation_units",
+                                               params,
+                                               &iterate_donation_units_cb,
+                                               &ctx);
 }

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