minor code cleanup

This commit is contained in:
Christian Grothoff 2020-03-10 17:11:12 +01:00
parent 883c063f43
commit f32193aae2
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC
2 changed files with 9 additions and 27 deletions

View File

@ -1150,16 +1150,6 @@ static void
request_keys (void *cls); request_keys (void *cls);
/**
* Put the handle back to the init state. Might
* be useful to force-download all /keys.
*
* @param h exchange handle.
*/
void
TEAH_handle_reset (struct TALER_EXCHANGE_Handle *h);
/** /**
* Set the fake now to be used when requesting "/keys". * Set the fake now to be used when requesting "/keys".
* *
@ -1208,7 +1198,7 @@ TALER_EXCHANGE_set_last_denom (struct TALER_EXCHANGE_Handle *exchange,
* *
* @param exchange exchange to check keys for * @param exchange exchange to check keys for
* @param force_download #GNUNET_YES to force download even if /keys is still valid * @param force_download #GNUNET_YES to force download even if /keys is still valid
* @param pull_all_keys if GNUNET_YES, then the exchange state is reset to 'init', * @param pull_all_keys if #GNUNET_YES, then the exchange state is reset to #MHS_INIT,
* and all denoms will be redownloaded. * and all denoms will be redownloaded.
* @return until when the response is current, 0 if we are re-downloading * @return until when the response is current, 0 if we are re-downloading
*/ */
@ -1222,8 +1212,10 @@ TALER_EXCHANGE_check_keys_current (struct TALER_EXCHANGE_Handle *exchange,
if (GNUNET_YES == pull_all_keys) if (GNUNET_YES == pull_all_keys)
{ {
GNUNET_assert (GNUNET_YES == force_download); GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
TEAH_handle_reset (exchange); "Forcing re-download of all keys\n");
GNUNET_break (GNUNET_YES == force_download);
exchange->state = MHS_INIT;
} }
if ( (GNUNET_NO == force_download) && if ( (GNUNET_NO == force_download) &&
(0 < GNUNET_TIME_absolute_get_remaining ( (0 < GNUNET_TIME_absolute_get_remaining (
@ -1373,6 +1365,8 @@ keys_completed_cb (void *cls,
exchange->kr = NULL; exchange->kr = NULL;
free_keys_request (kr); free_keys_request (kr);
exchange->state = MHS_FAILED; exchange->state = MHS_FAILED;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"/keys download failed\n");
if (NULL != exchange->key_data_raw) if (NULL != exchange->key_data_raw)
{ {
json_decref (exchange->key_data_raw); json_decref (exchange->key_data_raw);
@ -1415,19 +1409,6 @@ TEAH_handle_to_context (struct TALER_EXCHANGE_Handle *h)
} }
/**
* Put the handle back to the init state. Might
* be useful to force-download all /keys.
*
* @param h exchange handle.
*/
void
TEAH_handle_reset (struct TALER_EXCHANGE_Handle *h)
{
h->state = MHS_INIT;
}
/** /**
* Check if the handle is ready to process requests. * Check if the handle is ready to process requests.
* *

View File

@ -161,7 +161,8 @@ run (void *cls,
* key set. The new KS will have only one key, because the * key set. The new KS will have only one key, because the
* current lookahead_sign == 60 seconds and the key's withdraw * current lookahead_sign == 60 seconds and the key's withdraw
* duration is 80 seconds. * duration is 80 seconds.
*/TALER_TESTING_cmd_exec_keyup_with_now *///
TALER_TESTING_cmd_exec_keyup_with_now
("keyup-1", ("keyup-1",
CONFIG_FILE, CONFIG_FILE,
TTH_parse_time (JAN2030)), TTH_parse_time (JAN2030)),