diff options
author | Christian Grothoff <christian@grothoff.org> | 2021-08-23 12:50:34 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2021-08-23 12:51:07 +0200 |
commit | e7e10a2931cc19969b2c060a0996506e5b7ce43e (patch) | |
tree | 377da45437911a06a8014aead814f2719b06bcd6 /src/stasis | |
parent | c533c5441456cb81e64be24f52eb1ee35ee3243e (diff) | |
download | anastasis-e7e10a2931cc19969b2c060a0996506e5b7ce43e.tar.gz anastasis-e7e10a2931cc19969b2c060a0996506e5b7ce43e.tar.bz2 anastasis-e7e10a2931cc19969b2c060a0996506e5b7ce43e.zip |
-misc bugfixes for IBAN plugin
Diffstat (limited to 'src/stasis')
-rw-r--r-- | src/stasis/plugin_anastasis_postgres.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/stasis/plugin_anastasis_postgres.c b/src/stasis/plugin_anastasis_postgres.c index b7fda3d..8c06243 100644 --- a/src/stasis/plugin_anastasis_postgres.c +++ b/src/stasis/plugin_anastasis_postgres.c @@ -1945,14 +1945,14 @@ static enum GNUNET_DB_QueryStatus postgres_test_challenge_code_satisfied ( void *cls, const struct ANASTASIS_CRYPTO_TruthUUIDP *truth_uuid, - const uint64_t code) + const uint64_t code, + struct GNUNET_TIME_Absolute after) { struct PostgresClosure *pg = cls; - struct GNUNET_TIME_Absolute now = GNUNET_TIME_absolute_get (); struct GNUNET_PQ_QueryParam params[] = { GNUNET_PQ_query_param_auto_from_type (truth_uuid), GNUNET_PQ_query_param_uint64 (&code), - GNUNET_PQ_query_param_absolute_time (&now), + GNUNET_PQ_query_param_absolute_time (&after), GNUNET_PQ_query_param_end }; struct GNUNET_PQ_ResultSpec rs[] = { @@ -2558,6 +2558,14 @@ libanastasis_plugin_db_postgres_init (void *cls) " ORDER BY creation_date DESC" " LIMIT 1);", 2), + GNUNET_PQ_make_prepare ("challengecode_test_satisfied", + "SELECT 1 FROM anastasis_challengecode" + " WHERE truth_uuid=$1" + " AND satisfied=TRUE" + " AND code=$2" + " AND creation_date >= $3" + " LIMIT 1;", + 3), GNUNET_PQ_make_prepare ("challengecode_select_meta", "SELECT " " code" |