From 0e6c4ba898b0f4c7e53b02a65f99cc4b6b066ad7 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 15 Jun 2017 22:10:12 +0200 Subject: work on #5010 --- src/auditordb/plugin_auditordb_postgres.c | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) (limited to 'src/auditordb/plugin_auditordb_postgres.c') diff --git a/src/auditordb/plugin_auditordb_postgres.c b/src/auditordb/plugin_auditordb_postgres.c index f144746a..57f9e89c 100644 --- a/src/auditordb/plugin_auditordb_postgres.c +++ b/src/auditordb/plugin_auditordb_postgres.c @@ -1159,16 +1159,13 @@ postgres_gc (void *cls) * @param cls the @e cls of this struct with the plugin-specific state * @param session connection to use * @param issue issuing information with value, fees and other info about the denomination - * @return #GNUNET_OK on success; #GNUNET_SYSERR on failure + * @return operation status result */ -static int +static enum GNUNET_DB_QueryStatus postgres_insert_denomination_info (void *cls, struct TALER_AUDITORDB_Session *session, const struct TALER_DenominationKeyValidityPS *issue) { - PGresult *result; - int ret; - struct GNUNET_PQ_QueryParam params[] = { GNUNET_PQ_query_param_auto_from_type (&issue->denom_hash), GNUNET_PQ_query_param_auto_from_type (&issue->master), @@ -1198,20 +1195,9 @@ postgres_insert_denomination_info (void *cls, TALER_amount_cmp_currency_nbo (&issue->value, &issue->fee_refund)); - result = GNUNET_PQ_exec_prepared (session->conn, - "auditor_denominations_insert", - params); - if (PGRES_COMMAND_OK != PQresultStatus (result)) - { - ret = GNUNET_SYSERR; - BREAK_DB_ERR (result); - } - else - { - ret = GNUNET_OK; - } - PQclear (result); - return ret; + return GNUNET_PQ_eval_prepared_non_select (session->conn, + "auditor_denominations_insert", + params); } @@ -1237,6 +1223,7 @@ postgres_select_denomination_info (void *cls, GNUNET_PQ_query_param_end }; PGresult *result; + result = GNUNET_PQ_exec_prepared (session->conn, "auditor_denominations_select", params); -- cgit v1.2.3