gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] branch master updated: fix account update failing to pe


From: gnunet
Subject: [taler-exchange] branch master updated: fix account update failing to persist wire signature and then breaking that wire account for good
Date: Fri, 08 Mar 2024 18:44:13 +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 9a5a9616 fix account update failing to persist wire signature and then 
breaking that wire account for good
     new 1beb3e72 Merge branch 'master' of git+ssh://git.taler.net/exchange
9a5a9616 is described below

commit 9a5a961622c22e26d0378279c1b5fdaa886c6063
Author: Christian Grothoff <grothoff@gnunet.org>
AuthorDate: Fri Mar 8 18:43:54 2024 +0100

    fix account update failing to persist wire signature and then breaking that 
wire account for good
---
 src/exchange/taler-exchange-httpd_management_wire_disable.c | 3 ++-
 src/exchange/taler-exchange-httpd_management_wire_enable.c  | 3 ++-
 src/exchangedb/pg_update_wire.c                             | 5 +++++
 src/exchangedb/pg_update_wire.h                             | 2 ++
 src/include/taler_exchangedb_plugin.h                       | 2 ++
 5 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/src/exchange/taler-exchange-httpd_management_wire_disable.c 
b/src/exchange/taler-exchange-httpd_management_wire_disable.c
index d3015fb6..53bece61 100644
--- a/src/exchange/taler-exchange-httpd_management_wire_disable.c
+++ b/src/exchange/taler-exchange-httpd_management_wire_disable.c
@@ -103,7 +103,7 @@ del_wire (void *cls,
       NULL);
     return GNUNET_DB_STATUS_HARD_ERROR;
   }
-  if (0 == qs)
+  if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == qs)
   {
     *mhd_ret = TALER_MHD_reply_with_error (
       connection,
@@ -118,6 +118,7 @@ del_wire (void *cls,
                                 NULL,
                                 NULL,
                                 awc->validity_end,
+                                NULL,
                                 false);
   if (qs < 0)
   {
diff --git a/src/exchange/taler-exchange-httpd_management_wire_enable.c 
b/src/exchange/taler-exchange-httpd_management_wire_enable.c
index ca5b4ee7..e7c771cc 100644
--- a/src/exchange/taler-exchange-httpd_management_wire_enable.c
+++ b/src/exchange/taler-exchange-httpd_management_wire_enable.c
@@ -126,7 +126,7 @@ add_wire (void *cls,
       NULL);
     return GNUNET_DB_STATUS_HARD_ERROR;
   }
-  if (0 == qs)
+  if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == qs)
     qs = TEH_plugin->insert_wire (TEH_plugin->cls,
                                   awc->payto_uri,
                                   awc->conversion_url,
@@ -141,6 +141,7 @@ add_wire (void *cls,
                                   awc->debit_restrictions,
                                   awc->credit_restrictions,
                                   awc->validity_start,
+                                  &awc->master_sig_wire,
                                   true);
   if (qs < 0)
   {
diff --git a/src/exchangedb/pg_update_wire.c b/src/exchangedb/pg_update_wire.c
index f3b07468..439c92d4 100644
--- a/src/exchangedb/pg_update_wire.c
+++ b/src/exchangedb/pg_update_wire.c
@@ -33,6 +33,7 @@ TEH_PG_update_wire (void *cls,
                     const json_t *debit_restrictions,
                     const json_t *credit_restrictions,
                     struct GNUNET_TIME_Timestamp change_date,
+                    const struct TALER_MasterSignatureP *master_sig,
                     bool enabled)
 {
   struct PostgresClosure *pg = cls;
@@ -49,6 +50,9 @@ TEH_PG_update_wire (void *cls,
     ? TALER_PQ_query_param_json (credit_restrictions)
     : GNUNET_PQ_query_param_null (),
     GNUNET_PQ_query_param_timestamp (&change_date),
+    NULL == master_sig
+    ? GNUNET_PQ_query_param_null ()
+    : GNUNET_PQ_query_param_auto_from_type (master_sig),
     GNUNET_PQ_query_param_end
   };
 
@@ -61,6 +65,7 @@ TEH_PG_update_wire (void *cls,
            " ,debit_restrictions=$4"
            " ,credit_restrictions=$5"
            " ,last_change=$6"
+           " ,master_sig=$7"
            " WHERE payto_uri=$1");
   return GNUNET_PQ_eval_prepared_non_select (pg->conn,
                                              "update_wire",
diff --git a/src/exchangedb/pg_update_wire.h b/src/exchangedb/pg_update_wire.h
index ecdbc405..9c30816e 100644
--- a/src/exchangedb/pg_update_wire.h
+++ b/src/exchangedb/pg_update_wire.h
@@ -36,6 +36,7 @@
  * @param credit_restrictions JSON array with credit restrictions on the 
account; NULL allowed if not @a enabled
  * @param change_date date when the account status was last changed
  *                      (only to be used for replay detection)
+ * @param master_sig master signature to store, can be NULL (if @a enabled is 
false)
  * @param enabled true to enable, false to disable (the actual change)
  * @return transaction status code
  */
@@ -46,6 +47,7 @@ TEH_PG_update_wire (void *cls,
                     const json_t *debit_restrictions,
                     const json_t *credit_restrictions,
                     struct GNUNET_TIME_Timestamp change_date,
+                    const struct TALER_MasterSignatureP *master_sig,
                     bool enabled);
 
 #endif
diff --git a/src/include/taler_exchangedb_plugin.h 
b/src/include/taler_exchangedb_plugin.h
index 5cd63f2b..ccfacafc 100644
--- a/src/include/taler_exchangedb_plugin.h
+++ b/src/include/taler_exchangedb_plugin.h
@@ -5785,6 +5785,7 @@ struct TALER_EXCHANGEDB_Plugin
    * @param credit_restrictions JSON array with credit restrictions on the 
account; NULL allowed if not @a enabled
    * @param change_date date when the account status was last changed
    *                      (only to be used for replay detection)
+   * @param master_sig master signature to store, can be NULL (if @a enabled 
is false)
    * @param enabled true to enable, false to disable (the actual change)
    * @return transaction status code
    */
@@ -5795,6 +5796,7 @@ struct TALER_EXCHANGEDB_Plugin
                  const json_t *debit_restrictions,
                  const json_t *credit_restrictions,
                  struct GNUNET_TIME_Timestamp change_date,
+                 const struct TALER_MasterSignatureP *master_sig,
                  bool enabled);
 
 

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