diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/exchange/taler-exchange-httpd_kyc-proof.c | 2 | ||||
-rw-r--r-- | src/exchangedb/pg_lookup_kyc_process_by_account.c | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/exchange/taler-exchange-httpd_kyc-proof.c b/src/exchange/taler-exchange-httpd_kyc-proof.c index b9ec3563d..7885b8a31 100644 --- a/src/exchange/taler-exchange-httpd_kyc-proof.c +++ b/src/exchange/taler-exchange-httpd_kyc-proof.c @@ -444,7 +444,7 @@ TEH_handler_kyc_proof ( MHD_HTTP_INTERNAL_SERVER_ERROR, "kyc-proof-internal-error", TALER_EC_GENERIC_DB_STORE_FAILED, - "lookup_kyc_requirement_by_account"); + "lookup_kyc_process_by_account"); case GNUNET_DB_STATUS_SUCCESS_NO_RESULTS: return respond_html_ec (rc, MHD_HTTP_NOT_FOUND, diff --git a/src/exchangedb/pg_lookup_kyc_process_by_account.c b/src/exchangedb/pg_lookup_kyc_process_by_account.c index 79a9d6c8f..e8d9eaa94 100644 --- a/src/exchangedb/pg_lookup_kyc_process_by_account.c +++ b/src/exchangedb/pg_lookup_kyc_process_by_account.c @@ -60,7 +60,6 @@ TEH_PG_lookup_kyc_process_by_account ( *provider_account_id = NULL; *provider_legitimization_id = NULL; - /* Used in #postgres_lookup_kyc_process_by_account() */ PREPARE (pg, "lookup_process_by_account", "SELECT " @@ -70,7 +69,10 @@ TEH_PG_lookup_kyc_process_by_account ( ",provider_legitimization_id" " FROM legitimization_processes" " WHERE h_payto=$1" - " AND provider_section=$2;"); + " AND provider_section=$2" + " AND NOT finished" + " ORDER BY expiration_time DESC" + " LIMIT 1;"); return GNUNET_PQ_eval_prepared_singleton_select ( pg->conn, "lookup_process_by_account", |