diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-06-10 11:34:21 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-06-10 11:34:21 +0200 |
commit | 29a8047d6fd7baa083a47bde4aa40c264c8fbb7f (patch) | |
tree | 3d36963d1083ca90eea598b3fb2931b84be2d3c1 /src/mintdb/plugin_mintdb_postgres.c | |
parent | 84c21460b61217ec89ecbdc913d2a083ed255cbe (diff) | |
download | exchange-29a8047d6fd7baa083a47bde4aa40c264c8fbb7f.tar.gz exchange-29a8047d6fd7baa083a47bde4aa40c264c8fbb7f.tar.bz2 exchange-29a8047d6fd7baa083a47bde4aa40c264c8fbb7f.zip |
use better names than i/j
Diffstat (limited to 'src/mintdb/plugin_mintdb_postgres.c')
-rw-r--r-- | src/mintdb/plugin_mintdb_postgres.c | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/src/mintdb/plugin_mintdb_postgres.c b/src/mintdb/plugin_mintdb_postgres.c index 31dc91a4f..6472e1fbe 100644 --- a/src/mintdb/plugin_mintdb_postgres.c +++ b/src/mintdb/plugin_mintdb_postgres.c @@ -2152,7 +2152,7 @@ postgres_get_refresh_order (void *cls, * @param cls the `struct PostgresClosure` with the plugin-specific state * @param session database connection to use * @param session_hash hash to identify refresh session - * @param i set index (1st dimension) + * @param cnc_index cut and choose index (1st dimension) * @param num_newcoins coin index size of the @a commit_coins array * @param commit_coins array of coin commitments to store * @return #GNUNET_OK on success @@ -2162,12 +2162,12 @@ static int postgres_insert_refresh_commit_coins (void *cls, struct TALER_MINTDB_Session *session, const struct GNUNET_HashCode *session_hash, - unsigned int i, + unsigned int cnc_index, unsigned int num_newcoins, const struct TALER_MINTDB_RefreshCommitCoin *commit_coins) { // FIXME: check logic! -- was written for single commit_coin! // #3831 - uint16_t cnc_index_nbo = htons (i); // #3827 + uint16_t cnc_index_nbo = htons (cnc_index); // #3827 uint16_t newcoin_index_nbo = htons (num_newcoins); // #3827 char *rle; size_t rle_size; @@ -2306,29 +2306,28 @@ postgres_get_refresh_commit_coins (void *cls, * @param cls the `struct PostgresClosure` with the plugin-specific state * @param session database connection to use * @param session_hash hash to identify refresh session - * FIXME: i/j -- better names, please! - * @param i set index (1st dimension) - * @param j coin index (2nd dimension), corresponds to melted (old) coins - * @param commit_link link information to store + * @param cnc_index cut and choose index (1st dimension) + * @param num_links size of the @a links array to return + * @param[out] links array of link information to store return * @return #GNUNET_SYSERR on internal error, #GNUNET_OK on success */ static int postgres_insert_refresh_commit_links (void *cls, struct TALER_MINTDB_Session *session, const struct GNUNET_HashCode *session_hash, - unsigned int i, - unsigned int j, - const struct TALER_MINTDB_RefreshCommitLinkP *commit_link) + unsigned int cnc_index, + unsigned int num_links, + const struct TALER_MINTDB_RefreshCommitLinkP *links) { // FIXME: check logic! - uint16_t cnc_index_nbo = htons (i); // #3827 - uint16_t oldcoin_index_nbo = htons (j); // #3827 + uint16_t cnc_index_nbo = htons (cnc_index); // #3827 + uint16_t oldcoin_index_nbo = htons (num_links); // #3827 struct TALER_PQ_QueryParam params[] = { - TALER_PQ_query_param_auto_from_type(session_hash), - TALER_PQ_query_param_auto_from_type(&commit_link->transfer_pub), - TALER_PQ_query_param_auto_from_type(&cnc_index_nbo), - TALER_PQ_query_param_auto_from_type(&oldcoin_index_nbo), - TALER_PQ_query_param_auto_from_type(&commit_link->shared_secret_enc), + TALER_PQ_query_param_auto_from_type (session_hash), + TALER_PQ_query_param_auto_from_type (&links->transfer_pub), + TALER_PQ_query_param_auto_from_type (&cnc_index_nbo), + TALER_PQ_query_param_auto_from_type (&oldcoin_index_nbo), + TALER_PQ_query_param_auto_from_type (&links->shared_secret_enc), TALER_PQ_query_param_end }; @@ -2360,7 +2359,7 @@ postgres_insert_refresh_commit_links (void *cls, * @param cls the `struct PostgresClosure` with the plugin-specific state * @param session database connection to use * @param session_hash hash to identify refresh session - * @param i set index (1st dimension) + * @param cnc_index cut and choose index (1st dimension) * @param num_links size of the @a commit_link array * @param[out] links array of link information to return * @return #GNUNET_SYSERR on internal error, @@ -2371,12 +2370,12 @@ static int postgres_get_refresh_commit_links (void *cls, struct TALER_MINTDB_Session *session, const struct GNUNET_HashCode *session_hash, - unsigned int i, + unsigned int cnc_index, unsigned int num_links, struct TALER_MINTDB_RefreshCommitLinkP *links) { // FIXME: check logic: was written for a single link! - uint16_t cnc_index_nbo = htons (i); // #3827 + uint16_t cnc_index_nbo = htons (cnc_index); // #3827 uint16_t oldcoin_index_nbo = htons (num_links); // #3827 struct TALER_PQ_QueryParam params[] = { |