From 154043468c0de4fb87fb66eebf5110f8ff909ea5 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 7 Aug 2021 16:40:36 +0200 Subject: -code cleanup: use new GNUNET_TIME functions --- src/backend/taler-merchant-httpd_exchanges.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/backend/taler-merchant-httpd_exchanges.c') diff --git a/src/backend/taler-merchant-httpd_exchanges.c b/src/backend/taler-merchant-httpd_exchanges.c index 16d9e481..dbafcbfb 100644 --- a/src/backend/taler-merchant-httpd_exchanges.c +++ b/src/backend/taler-merchant-httpd_exchanges.c @@ -567,7 +567,7 @@ process_find_operations (struct Exchange *exchange) { need_wire = true; /* Do not warn if this is before our first attempt */ - if (0 != exchange->wire_retry_delay.rel_value_us) + if (! GNUNET_TIME_relative_is_zero (exchange->wire_retry_delay)) GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Exchange does not support `%s' wire method (will retry later)\n", fo->wire_method); @@ -976,7 +976,7 @@ keys_mgmt_cb (void *cls, delay = RELOAD_DELAY; else delay = GNUNET_TIME_absolute_get_remaining (expire); - if (0 == delay.rel_value_us) + if (GNUNET_TIME_relative_is_zero (delay)) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "/keys response from exchange expired immediately! Retrying in 1 minute.\n"); @@ -1089,11 +1089,8 @@ 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 ( (force_reload) && - (0 == GNUNET_TIME_absolute_get_remaining ( - exchange->first_retry).rel_value_us) ) + (GNUNET_TIME_absolute_is_past (exchange->first_retry)) ) { /* increment exponential-backoff */ exchange->retry_delay = RETRY_BACKOFF (exchange->retry_delay); @@ -1108,7 +1105,8 @@ TMH_EXCHANGES_find_exchange (const char *chosen_exchange, return fo; } - + now = GNUNET_TIME_absolute_get (); + (void) GNUNET_TIME_round_abs (&now); if ( (! exchange->pending) && ( (NULL == fo->wire_method) || (NULL != get_wire_fees (exchange, -- cgit v1.2.3