From b9f1384b528b9257cef3c220a747be1c9df2f028 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 16 Jul 2020 20:27:52 +0200 Subject: avoid boolean flags, see #6188 --- src/include/taler_exchange_service.h | 42 ++++++++++++++++++++++++++++++------ 1 file changed, 36 insertions(+), 6 deletions(-) (limited to 'src/include/taler_exchange_service.h') diff --git a/src/include/taler_exchange_service.h b/src/include/taler_exchange_service.h index 4d8adcc81..441a93c7e 100644 --- a/src/include/taler_exchange_service.h +++ b/src/include/taler_exchange_service.h @@ -503,20 +503,50 @@ TALER_EXCHANGE_set_last_denom (struct TALER_EXCHANGE_Handle *exchange, struct GNUNET_TIME_Absolute last_denom_new); +/** + * Flags for #TALER_EXCHANGE_check_keys_current(). + */ +enum TALER_EXCHANGE_CheckKeysFlags +{ + /** + * No special options. + */ + TALER_EXCHANGE_CKF_NONE, + + /** + * Force downloading /keys now, even if /keys is still valid + * (that is, the period advertised by the exchange for re-downloads + * has not yet expired). + */ + TALER_EXCHANGE_CKF_FORCE_DOWNLOAD = 1, + + /** + * Pull all keys again, resetting the client state to the original state. + * Using this flag disables the incremental download, and also prevents using + * the context until the re-download has completed. + */ + TALER_EXCHANGE_CKF_PULL_ALL_KEYS = 2, + + /** + * Force downloading all keys now. + */ + TALER_EXCHANGE_CKF_FORCE_ALL_NOW = TALER_EXCHANGE_CKF_FORCE_DOWNLOAD + | TALER_EXCHANGE_CKF_PULL_ALL_KEYS + +}; + + /** * Check if our current response for /keys is valid, and if * not, trigger /keys download. * * @param exchange exchange to check keys for - * @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 #MHS_INIT, - * and all denoms will be redownloaded. - * @return until when the response is current, 0 if we are re-downloading + * @param flags options controlling when to download what + * @return until when the existing response is current, 0 if we are re-downloading now */ struct GNUNET_TIME_Absolute TALER_EXCHANGE_check_keys_current (struct TALER_EXCHANGE_Handle *exchange, - int force_download, - int pull_all_keys); + enum TALER_EXCHANGE_CheckKeysFlags flags); /** -- cgit v1.2.3