fix DB query and error handling

This commit is contained in:
Christian Grothoff 2021-11-17 11:01:19 +01:00
parent 422b0ffd4c
commit ed1db63a48
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC
3 changed files with 18 additions and 4 deletions

View File

@ -168,10 +168,19 @@ persist_kyc_ok (void *cls,
MHD_RESULT *mhd_ret)
{
struct KycProofContext *kpc = cls;
enum GNUNET_DB_QueryStatus qs;
return TEH_plugin->set_kyc_ok (TEH_plugin->cls,
kpc->payment_target_uuid,
kpc->id);
qs = TEH_plugin->set_kyc_ok (TEH_plugin->cls,
kpc->payment_target_uuid,
kpc->id);
if (GNUNET_DB_STATUS_HARD_ERROR == qs)
{
GNUNET_break (0);
*mhd_ret = TALER_MHD_reply_with_ec (connection,
TALER_EC_GENERIC_DB_STORE_FAILED,
"set_kyc_ok");
}
return qs;
}

View File

@ -3810,6 +3810,10 @@ postgres_set_kyc_ok (void *cls,
{
struct PostgresClosure *pg = cls;
struct GNUNET_PQ_QueryParam params[] = {
GNUNET_PQ_query_param_uint64 (&payment_target_uuid),
GNUNET_PQ_query_param_end
};
struct GNUNET_PQ_QueryParam params2[] = {
GNUNET_PQ_query_param_uint64 (&payment_target_uuid),
GNUNET_PQ_query_param_string (id),
GNUNET_PQ_query_param_end
@ -3827,7 +3831,7 @@ postgres_set_kyc_ok (void *cls,
qs = GNUNET_PQ_eval_prepared_non_select (pg->conn,
"set_kyc_ok",
params);
params2);
if (qs <= 0)
return qs;
qs = GNUNET_PQ_eval_prepared_singleton_select (pg->conn,

View File

@ -72,6 +72,7 @@ aggregator_run (void *cls,
"taler-exchange-aggregator",
"taler-exchange-aggregator",
"-c", as->config_filename,
"-L", "INFO",
"-t", /* exit when done */
(as->kyc_on)
? NULL