diff options
author | Christian Grothoff <christian@grothoff.org> | 2021-08-07 16:40:36 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2021-08-07 16:40:36 +0200 |
commit | 154043468c0de4fb87fb66eebf5110f8ff909ea5 (patch) | |
tree | fda0219c7f7857318b83f1ca1bc7247a50ee107e /src/backend/taler-merchant-httpd_exchanges.c | |
parent | 8e703ec55501282f5fade998d8ce173f81f5fa49 (diff) | |
download | merchant-154043468c0de4fb87fb66eebf5110f8ff909ea5.tar.gz merchant-154043468c0de4fb87fb66eebf5110f8ff909ea5.tar.bz2 merchant-154043468c0de4fb87fb66eebf5110f8ff909ea5.zip |
-code cleanup: use new GNUNET_TIME functions
Diffstat (limited to 'src/backend/taler-merchant-httpd_exchanges.c')
-rw-r--r-- | src/backend/taler-merchant-httpd_exchanges.c | 12 |
1 files changed, 5 insertions, 7 deletions
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, |