select on denom_pub_hash instead of denom_pub as the hash is a primary key

This commit is contained in:
Christian Grothoff 2017-07-14 17:49:34 +02:00
parent 2c6956f32a
commit e1aa257ee1
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC

View File

@ -504,7 +504,7 @@ postgres_prepare (PGconn *db_conn)
",fee_refund_frac" ",fee_refund_frac"
",fee_refund_curr" /* must match coin_curr */ ",fee_refund_curr" /* must match coin_curr */
" FROM denominations" " FROM denominations"
" WHERE denom_pub=$1;", " WHERE denom_pub_hash=$1;",
1), 1),
/* Used in #postgres_insert_denomination_revocation() */ /* Used in #postgres_insert_denomination_revocation() */
GNUNET_PQ_make_prepare ("denomination_revocation_insert", GNUNET_PQ_make_prepare ("denomination_revocation_insert",
@ -1687,8 +1687,9 @@ postgres_get_denomination_info (void *cls,
struct TALER_EXCHANGEDB_DenominationKeyInformationP *issue) struct TALER_EXCHANGEDB_DenominationKeyInformationP *issue)
{ {
enum GNUNET_DB_QueryStatus qs; enum GNUNET_DB_QueryStatus qs;
struct GNUNET_HashCode dph;
struct GNUNET_PQ_QueryParam params[] = { struct GNUNET_PQ_QueryParam params[] = {
GNUNET_PQ_query_param_rsa_public_key (denom_pub->rsa_public_key), GNUNET_PQ_query_param_auto_from_type (&dph),
GNUNET_PQ_query_param_end GNUNET_PQ_query_param_end
}; };
struct GNUNET_PQ_ResultSpec rs[] = { struct GNUNET_PQ_ResultSpec rs[] = {
@ -1717,6 +1718,8 @@ postgres_get_denomination_info (void *cls,
GNUNET_PQ_result_spec_end GNUNET_PQ_result_spec_end
}; };
GNUNET_CRYPTO_rsa_public_key_hash (denom_pub->rsa_public_key,
&dph);
qs = GNUNET_PQ_eval_prepared_singleton_select (session->conn, qs = GNUNET_PQ_eval_prepared_singleton_select (session->conn,
"denomination_get", "denomination_get",
params, params,