diff options
Diffstat (limited to 'src/backend/taler-merchant-httpd_exchanges.c')
-rw-r--r-- | src/backend/taler-merchant-httpd_exchanges.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/backend/taler-merchant-httpd_exchanges.c b/src/backend/taler-merchant-httpd_exchanges.c index df38bca2..f4695184 100644 --- a/src/backend/taler-merchant-httpd_exchanges.c +++ b/src/backend/taler-merchant-httpd_exchanges.c @@ -1191,6 +1191,7 @@ TMH_EXCHANGES_find_exchange (const char *chosen_exchange, GNUNET_CONTAINER_DLL_insert (exchange->fo_head, exchange->fo_tail, fo); + if ( (GNUNET_TIME_absolute_is_past (exchange->first_retry)) && (force_reload || (GNUNET_TIME_absolute_is_past ( @@ -1207,9 +1208,20 @@ TMH_EXCHANGES_find_exchange (const char *chosen_exchange, GNUNET_log (GNUNET_ERROR_TYPE_INFO, "/keys retry forced, waiting until %s\n", GNUNET_TIME_absolute2s (exchange->first_retry)); - exchange->keys_expiration - = TALER_EXCHANGE_check_keys_current (exchange->conn, - TALER_EXCHANGE_CKF_FORCE_DOWNLOAD); + if (NULL == exchange->conn) + { + /* Not connected at all yet */ + exchange->retry_task + = GNUNET_SCHEDULER_add_now (&retry_exchange, + exchange); + } + else + { + /* Use existing connection, but update /keys */ + exchange->keys_expiration + = TALER_EXCHANGE_check_keys_current (exchange->conn, + TALER_EXCHANGE_CKF_FORCE_DOWNLOAD); + } return fo; } |