gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] 01/02: -p2p fixes


From: gnunet
Subject: [taler-exchange] 01/02: -p2p fixes
Date: Wed, 27 Apr 2022 10:34:40 +0200

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

grothoff pushed a commit to branch master
in repository exchange.

commit 521e0bbcb5a2bb247678bc69aef7d85c16944865
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Wed Apr 27 10:16:51 2022 +0200

    -p2p fixes
---
 src/exchange/taler-exchange-httpd_purses_create.c  | 10 ++++++----
 src/exchange/taler-exchange-httpd_reserves_purse.c | 11 +++++++----
 src/exchangedb/drop-common.sql                     |  2 +-
 src/exchangedb/exchange-0001-part.sql              |  2 +-
 4 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/src/exchange/taler-exchange-httpd_purses_create.c 
b/src/exchange/taler-exchange-httpd_purses_create.c
index acd9bcc5..4034978b 100644
--- a/src/exchange/taler-exchange-httpd_purses_create.c
+++ b/src/exchange/taler-exchange-httpd_purses_create.c
@@ -243,7 +243,7 @@ create_transaction (void *cls,
                                   MHD_HTTP_INTERNAL_SERVER_ERROR,
                                   TALER_EC_GENERIC_DB_STORE_FAILED,
                                   "purse create");
-    return qs;
+    return GNUNET_DB_STATUS_HARD_ERROR;
   }
   if (in_conflict)
   {
@@ -314,13 +314,14 @@ create_transaction (void *cls,
     {
       if (GNUNET_DB_STATUS_SOFT_ERROR == qs)
         return qs;
+      GNUNET_break (0 != qs);
       TALER_LOG_WARNING (
         "Failed to store purse deposit information in database\n");
       *mhd_ret = TALER_MHD_reply_with_error (connection,
                                              MHD_HTTP_INTERNAL_SERVER_ERROR,
                                              TALER_EC_GENERIC_DB_STORE_FAILED,
                                              "purse create deposit");
-      return qs;
+      return GNUNET_DB_STATUS_HARD_ERROR;
     }
     if (! balance_ok)
     {
@@ -394,7 +395,7 @@ create_transaction (void *cls,
                                            MHD_HTTP_INTERNAL_SERVER_ERROR,
                                            TALER_EC_GENERIC_DB_STORE_FAILED,
                                            "purse create contract");
-    return qs;
+    return GNUNET_DB_STATUS_HARD_ERROR;
   }
   if (in_conflict)
   {
@@ -414,13 +415,14 @@ create_transaction (void *cls,
     {
       if (GNUNET_DB_STATUS_SOFT_ERROR == qs)
         return qs;
+      GNUNET_break (0 != qs);
       TALER_LOG_WARNING (
         "Failed to store fetch contract information from database\n");
       *mhd_ret = TALER_MHD_reply_with_error (connection,
                                              MHD_HTTP_INTERNAL_SERVER_ERROR,
                                              TALER_EC_GENERIC_DB_FETCH_FAILED,
                                              "select contract");
-      return qs;
+      return GNUNET_DB_STATUS_HARD_ERROR;
     }
     GNUNET_CRYPTO_hash (econtract,
                         econtract_size,
diff --git a/src/exchange/taler-exchange-httpd_reserves_purse.c 
b/src/exchange/taler-exchange-httpd_reserves_purse.c
index 825b8acc..3991b416 100644
--- a/src/exchange/taler-exchange-httpd_reserves_purse.c
+++ b/src/exchange/taler-exchange-httpd_reserves_purse.c
@@ -223,7 +223,7 @@ purse_transaction (void *cls,
                                     MHD_HTTP_INTERNAL_SERVER_ERROR,
                                     TALER_EC_GENERIC_DB_STORE_FAILED,
                                     "insert purse request");
-      return qs;
+      return GNUNET_DB_STATUS_HARD_ERROR;
     }
     if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == qs)
       return qs;
@@ -250,6 +250,7 @@ purse_transaction (void *cls,
       if (qs <= 0)
       {
         GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR != qs);
+        GNUNET_break (0 != qs);
         TALER_LOG_WARNING ("Failed to fetch purse information from 
database\n");
         *mhd_ret = TALER_MHD_reply_with_error (connection,
                                                MHD_HTTP_INTERNAL_SERVER_ERROR,
@@ -304,7 +305,7 @@ purse_transaction (void *cls,
                                     MHD_HTTP_INTERNAL_SERVER_ERROR,
                                     TALER_EC_GENERIC_DB_STORE_FAILED,
                                     "do reserve purse");
-      return qs;
+      return GNUNET_DB_STATUS_HARD_ERROR;
     }
     if (in_conflict)
     {
@@ -326,6 +327,7 @@ purse_transaction (void *cls,
       if (qs <= 0)
       {
         GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR != qs);
+        GNUNET_break (0 != qs);
         TALER_LOG_WARNING (
           "Failed to fetch purse merge information from database\n");
         *mhd_ret = TALER_MHD_reply_with_error (connection,
@@ -385,7 +387,7 @@ purse_transaction (void *cls,
                                              MHD_HTTP_INTERNAL_SERVER_ERROR,
                                              TALER_EC_GENERIC_DB_STORE_FAILED,
                                              "purse purse contract");
-      return qs;
+      return GNUNET_DB_STATUS_HARD_ERROR;
     }
     if (in_conflict)
     {
@@ -405,13 +407,14 @@ purse_transaction (void *cls,
       {
         if (GNUNET_DB_STATUS_SOFT_ERROR == qs)
           return qs;
+        GNUNET_break (0 != qs);
         TALER_LOG_WARNING (
           "Failed to store fetch contract information from database\n");
         *mhd_ret = TALER_MHD_reply_with_error (connection,
                                                MHD_HTTP_INTERNAL_SERVER_ERROR,
                                                
TALER_EC_GENERIC_DB_FETCH_FAILED,
                                                "select contract");
-        return qs;
+        return GNUNET_DB_STATUS_HARD_ERROR;
       }
       GNUNET_CRYPTO_hash (econtract,
                           econtract_size,
diff --git a/src/exchangedb/drop-common.sql b/src/exchangedb/drop-common.sql
index b14a00c8..3bdff7de 100644
--- a/src/exchangedb/drop-common.sql
+++ b/src/exchangedb/drop-common.sql
@@ -92,4 +92,4 @@ DROP FUNCTION IF EXISTS create_foreign_range_partition;
 DROP FUNCTION IF EXISTS create_foreign_servers;
 DROP FUNCTION IF EXISTS create_shard_server;
 
-COMMIT;
\ No newline at end of file
+COMMIT;
diff --git a/src/exchangedb/exchange-0001-part.sql 
b/src/exchangedb/exchange-0001-part.sql
index 9053e488..9ca66cd4 100644
--- a/src/exchangedb/exchange-0001-part.sql
+++ b/src/exchangedb/exchange-0001-part.sql
@@ -2716,7 +2716,7 @@ CREATE OR REPLACE FUNCTION exchange_do_reserve_purse(
   IN in_merge_timestamp INT8,
   IN in_reserve_sig BYTEA,
   IN in_purse_fee_val INT8,
-  IN in_purse_fee_frac INT8,
+  IN in_purse_fee_frac INT4,
   IN in_reserve_pub BYTEA,
   OUT out_no_funds BOOLEAN,
   OUT out_conflict BOOLEAN)

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