address FIXME: pass session when iterating over denominations

This commit is contained in:
Christian Grothoff 2020-12-22 18:13:46 +01:00
parent f17d886753
commit a644355c44
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC
3 changed files with 11 additions and 7 deletions

View File

@ -164,10 +164,10 @@ TALER_ARL_report (json_t *array,
* @param validity issuing information with value, fees and other info about the denomination.
*/
static void
add_denomination (void *cls,
add_denomination (
void *cls,
const struct TALER_DenominationPublicKey *denom_pub,
const struct
TALER_EXCHANGEDB_DenominationKeyInformationP *validity)
const struct TALER_EXCHANGEDB_DenominationKeyInformationP *validity)
{
const struct TALER_DenominationKeyValidityPS *issue = &validity->properties;
@ -292,7 +292,7 @@ TALER_ARL_get_denomination_info_by_hash (
denominations = GNUNET_CONTAINER_multihashmap_create (256,
GNUNET_NO);
qs = TALER_ARL_edb->iterate_denomination_info (TALER_ARL_edb->cls,
// FIXME: change API to pass session!?
TALER_ARL_esession,
&add_denomination,
NULL);
if (0 > qs)

View File

@ -2004,12 +2004,14 @@ domination_cb_helper (void *cls,
* Fetch information about all known denomination keys.
*
* @param cls the @e cls of this struct with the plugin-specific state
* @param session connection to use
* @param cb function to call on each denomination key
* @param cb_cls closure for @a cb
* @return transaction status code
*/
static enum GNUNET_DB_QueryStatus
postgres_iterate_denomination_info (void *cls,
struct TALER_EXCHANGEDB_Session *session,
TALER_EXCHANGEDB_DenominationCallback cb,
void *cb_cls)
{
@ -2022,8 +2024,8 @@ postgres_iterate_denomination_info (void *cls,
.cb_cls = cb_cls,
.pg = pc
};
struct TALER_EXCHANGEDB_Session *session;
if (NULL == session)
session = postgres_get_session (pc);
if (NULL == session)
return GNUNET_DB_STATUS_HARD_ERROR;

View File

@ -1904,12 +1904,14 @@ struct TALER_EXCHANGEDB_Plugin
* own read-only transaction (hence no session provided).
*
* @param cls the @e cls of this struct with the plugin-specific state
* @param session session to use
* @param cb function to call on each denomination key
* @param cb_cls closure for @a cb
* @return transaction status code
*/
enum GNUNET_DB_QueryStatus
(*iterate_denomination_info)(void *cls,
struct TALER_EXCHANGEDB_Session *session,
TALER_EXCHANGEDB_DenominationCallback cb,
void *cb_cls);