diff options
author | Christian Grothoff <christian@grothoff.org> | 2024-02-18 12:53:13 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2024-02-18 12:53:13 +0100 |
commit | 2d9d970bca7df7a45b60877baa608956e57c00e1 (patch) | |
tree | 44ed9621526703a4717e3abef998710b4afb7e08 /src/exchangedb | |
parent | 2504699b3b79ed7203d7413d8bbc91ffd28b5481 (diff) |
lproc is not unique if we have failed processes, handle multiple matches
Diffstat (limited to 'src/exchangedb')
-rw-r--r-- | src/exchangedb/pg_lookup_kyc_process_by_account.c | 6 |
1 files changed, 4 insertions, 2 deletions
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", |