gnunet-svn
[Top][All Lists]
Advanced

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

[taler-merchant] branch master updated: attempted fix for #7025


From: gnunet
Subject: [taler-merchant] branch master updated: attempted fix for #7025
Date: Sat, 02 Oct 2021 10:05:11 +0200

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

grothoff pushed a commit to branch master
in repository merchant.

The following commit(s) were added to refs/heads/master by this push:
     new 813f0ead attempted fix for #7025
813f0ead is described below

commit 813f0ead6717723b5de9ca00eb0d3d71b33d756d
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Sat Oct 2 10:05:08 2021 +0200

    attempted fix for #7025
---
 src/backend/taler-merchant-httpd_private-get-orders.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/src/backend/taler-merchant-httpd_private-get-orders.c 
b/src/backend/taler-merchant-httpd_private-get-orders.c
index e2796610..ba8b47c9 100644
--- a/src/backend/taler-merchant-httpd_private-get-orders.c
+++ b/src/backend/taler-merchant-httpd_private-get-orders.c
@@ -294,9 +294,9 @@ add_order (void *cls,
     po->result = TALER_EC_GENERIC_DB_FETCH_FAILED;
     return;
   }
-  /* qs == 0: contract terms don't exist, so the order cannot be paid. */
   if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == qs)
   {
+    /* Contract terms don't exist, so the order cannot be paid. */
     paid = false;
     if (NULL == orig_order_id)
     {
@@ -309,10 +309,8 @@ add_order (void *cls,
     order_id = GNUNET_strdup (orig_order_id);
   }
 
-  if (paid)
   {
-    /* if the order was paid, it must have been claimed, so use
-       lookup_contract_terms to avoid the order being deleted in the db. */
+    /* First try to find the order in the contracts */
     uint64_t os;
 
     qs = TMH_db->lookup_contract_terms (TMH_db->cls,
@@ -322,8 +320,9 @@ add_order (void *cls,
                                         &os,
                                         NULL);
   }
-  else
+  if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == qs)
   {
+    /* Might still be unclaimed, so try order table */
     struct GNUNET_HashCode unused;
 
     qs = TMH_db->lookup_order (TMH_db->cls,
@@ -333,10 +332,9 @@ add_order (void *cls,
                                &unused,
                                &contract_terms);
   }
-
   if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT != qs)
   {
-    GNUNET_break (0);
+    GNUNET_break (0); /* Failed: #7025 */
     po->result = TALER_EC_GENERIC_DB_FETCH_FAILED;
     json_decref (contract_terms);
     GNUNET_free (order_id);
@@ -770,6 +768,7 @@ TMH_private_get_orders (const struct TMH_RequestHandler *rh,
                               po);
   if (0 > qs)
   {
+    GNUNET_break (0);
     po->result = TALER_EC_GENERIC_DB_FETCH_FAILED;
   }
   if (TALER_EC_NONE != po->result)

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