gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-merchant] branch master updated: fix issues related


From: gnunet
Subject: [GNUnet-SVN] [taler-merchant] branch master updated: fix issues related to unrounded times
Date: Sat, 09 Dec 2017 19:57:36 +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 b5222ad  fix issues related to unrounded times
b5222ad is described below

commit b5222ad829c41ea9be890113e94ba6a96fcaedbc
Author: Christian Grothoff <address@hidden>
AuthorDate: Sat Dec 9 19:57:34 2017 +0100

    fix issues related to unrounded times
---
 src/backend/taler-merchant-httpd_exchanges.c | 6 ++++--
 src/backend/taler-merchant-httpd_history.c   | 2 +-
 src/backenddb/plugin_merchantdb_postgres.c   | 3 ++-
 src/backenddb/test_merchantdb.c              | 7 ++++---
 4 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/src/backend/taler-merchant-httpd_exchanges.c 
b/src/backend/taler-merchant-httpd_exchanges.c
index 9833181..4484689 100644
--- a/src/backend/taler-merchant-httpd_exchanges.c
+++ b/src/backend/taler-merchant-httpd_exchanges.c
@@ -789,6 +789,7 @@ TMH_EXCHANGES_find_exchange (const char *chosen_exchange,
 {
   struct Exchange *exchange;
   struct TMH_EXCHANGES_FindOperation *fo;
+  struct GNUNET_TIME_Absolute now;
 
   if (NULL == merchant_curl_ctx)
   {
@@ -840,11 +841,12 @@ TMH_EXCHANGES_find_exchange (const char *chosen_exchange,
   GNUNET_CONTAINER_DLL_insert (exchange->fo_head,
                                exchange->fo_tail,
                                fo);
-
+  now = GNUNET_TIME_absolute_get ();
+  (void) GNUNET_TIME_round_abs (&now);
   if ( (GNUNET_YES != exchange->pending) &&
        ( (NULL == fo->wire_method) ||
          (NULL != get_wire_fees (exchange,
-                                 GNUNET_TIME_absolute_get (),
+                                 now,
                                  fo->wire_method)) ) )
   {
     /* We are not currently waiting for a reply, immediately
diff --git a/src/backend/taler-merchant-httpd_history.c 
b/src/backend/taler-merchant-httpd_history.c
index 99c71a4..53adf30 100644
--- a/src/backend/taler-merchant-httpd_history.c
+++ b/src/backend/taler-merchant-httpd_history.c
@@ -137,7 +137,7 @@ MH_handler_history (struct TMH_RequestHandler *rh,
                                      MHD_GET_ARGUMENT_KIND,
                                      "date");
   date = GNUNET_TIME_absolute_get ();
-
+  (void) GNUNET_TIME_round_abs (&date);
   if (NULL != str)
   {
     if (1 != sscanf (str,
diff --git a/src/backenddb/plugin_merchantdb_postgres.c 
b/src/backenddb/plugin_merchantdb_postgres.c
index 6647a5a..835f2e6 100644
--- a/src/backenddb/plugin_merchantdb_postgres.c
+++ b/src/backenddb/plugin_merchantdb_postgres.c
@@ -2663,6 +2663,7 @@ postgres_enable_tip_reserve (void *cls,
     };
 
     now = GNUNET_TIME_absolute_get ();
+    (void) GNUNET_TIME_round_abs (&now);
     qs = GNUNET_PQ_eval_prepared_non_select (pg->conn,
                                              "insert_tip_credit_uuid",
                                              params);
@@ -2895,7 +2896,7 @@ postgres_authorize_tip (void *cls,
       GNUNET_PQ_query_param_end
     };
 
-    GNUNET_TIME_round_abs (&now);
+    (void) GNUNET_TIME_round_abs (&now);
     qs = GNUNET_PQ_eval_prepared_non_select (pg->conn,
                                              "insert_tip_justification",
                                              params);
diff --git a/src/backenddb/test_merchantdb.c b/src/backenddb/test_merchantdb.c
index 62a6c5e..942660a 100644
--- a/src/backenddb/test_merchantdb.c
+++ b/src/backenddb/test_merchantdb.c
@@ -392,6 +392,7 @@ test_wire_fee ()
   RND_BLK (&h_wire_method);
   RND_BLK (&exchange_sig);
   date1 = GNUNET_TIME_absolute_get ();
+  (void) GNUNET_TIME_abs_round (&date1);
   date2 = GNUNET_TIME_absolute_add (date1,
                                    GNUNET_TIME_UNIT_DAYS);
   date3 = GNUNET_TIME_absolute_add (date2,
@@ -799,11 +800,11 @@ run (void *cls)
   RND_BLK (&merchant_pub);
   RND_BLK (&wtid);
   timestamp = GNUNET_TIME_absolute_get ();
-  GNUNET_TIME_round_abs (&timestamp);
+  (void) GNUNET_TIME_round_abs (&timestamp);
   delta = GNUNET_TIME_UNIT_MINUTES;
   fake_now = GNUNET_TIME_absolute_add (timestamp, delta);
   refund_deadline = GNUNET_TIME_absolute_get();
-  GNUNET_TIME_round_abs (&refund_deadline);
+  (void) GNUNET_TIME_round_abs (&refund_deadline);
   GNUNET_assert (GNUNET_OK ==
                  TALER_string_to_amount (CURRENCY ":5",
                                          &amount_with_fee));
@@ -894,7 +895,7 @@ run (void *cls)
                                                         &pd_cb,
                                                         NULL));
   timestamp = GNUNET_TIME_absolute_get ();
-  GNUNET_TIME_round_abs (&timestamp);
+  (void) GNUNET_TIME_round_abs (&timestamp);
 
   FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
           plugin->insert_contract_terms (plugin->cls,

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



reply via email to

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