gnunet-svn
[Top][All Lists]
Advanced

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

[taler-merchant] branch master updated: contract can change between susp


From: gnunet
Subject: [taler-merchant] branch master updated: contract can change between suspend and resume, fetch it again
Date: Mon, 11 Nov 2019 20:04:43 +0100

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 4170ac4  contract can change between suspend and resume, fetch it again
4170ac4 is described below

commit 4170ac40d66b19b73913afdbf71bdfa33ac94e2f
Author: Christian Grothoff <address@hidden>
AuthorDate: Mon Nov 11 20:04:13 2019 +0100

    contract can change between suspend and resume, fetch it again
---
 src/backend/taler-merchant-httpd_check-payment.c | 66 ++++++++++++------------
 1 file changed, 34 insertions(+), 32 deletions(-)

diff --git a/src/backend/taler-merchant-httpd_check-payment.c 
b/src/backend/taler-merchant-httpd_check-payment.c
index 260f331..31e24d3 100644
--- a/src/backend/taler-merchant-httpd_check-payment.c
+++ b/src/backend/taler-merchant-httpd_check-payment.c
@@ -434,41 +434,43 @@ MH_handler_check_payment (struct TMH_RequestHandler *rh,
                 "Starting /check-payment processing with timeout %s\n",
                 GNUNET_STRINGS_absolute_time_to_string (
                   cprc->sc.long_poll_timeout));
-    db->preflight (db->cls);
-    qs = db->find_contract_terms (db->cls,
-                                  &cprc->contract_terms,
-                                  cprc->order_id,
-                                  &mi->pubkey);
-    if (0 > qs)
-    {
-      /* single, read-only SQL statements should never cause
-         serialization problems */
-      GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR != qs);
-      /* Always report on hard error as well to enable diagnostics */
-      GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs);
-      return TMH_RESPONSE_reply_internal_error (connection,
-                                                
TALER_EC_CHECK_PAYMENT_DB_FETCH_CONTRACT_TERMS_ERROR,
-                                                "db error fetching contract 
terms");
-    }
-
-    if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == qs)
-    {
-      /* Check that we're at least aware of the order */
-      return check_order_and_request_payment (cprc);
-    }
-    GNUNET_assert (NULL != cprc->contract_terms);
+  }
+  if (NULL != cprc->contract_terms)
+  {
+    json_decref (cprc->contract_terms);
+    cprc->contract_terms = NULL;
+  }
+  db->preflight (db->cls);
+  qs = db->find_contract_terms (db->cls,
+                                &cprc->contract_terms,
+                                cprc->order_id,
+                                &mi->pubkey);
+  if (0 > qs)
+  {
+    /* single, read-only SQL statements should never cause
+       serialization problems */
+    GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR != qs);
+    /* Always report on hard error as well to enable diagnostics */
+    GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs);
+    return TMH_RESPONSE_reply_internal_error (connection,
+                                              
TALER_EC_CHECK_PAYMENT_DB_FETCH_CONTRACT_TERMS_ERROR,
+                                              "db error fetching contract 
terms");
+  }
 
-    if (GNUNET_OK !=
-        parse_contract_terms (cprc))
-      return cprc->ret;
-    GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-                "Order `%s' matches contract %s\n",
-                cprc->order_id,
-                GNUNET_h2s (&cprc->h_contract_terms));
+  if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == qs)
+  {
+    /* Check that we're at least aware of the order */
+    return check_order_and_request_payment (cprc);
   }
+  GNUNET_assert (NULL != cprc->contract_terms);
+
+  if (GNUNET_OK !=
+      parse_contract_terms (cprc))
+    return cprc->ret;
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-              "Checking payment status for order `%s'\n",
-              cprc->order_id);
+              "Checkig payment status for order `%s' with contract %s\n",
+              cprc->order_id,
+              GNUNET_h2s (&cprc->h_contract_terms));
   GNUNET_assert (NULL != cprc->contract_terms);
 
   /* Check if the order has been paid for. */

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]