diff options
Diffstat (limited to 'src/stasis/plugin_anastasis_postgres.c')
-rw-r--r-- | src/stasis/plugin_anastasis_postgres.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/stasis/plugin_anastasis_postgres.c b/src/stasis/plugin_anastasis_postgres.c index 325bae8..4271f53 100644 --- a/src/stasis/plugin_anastasis_postgres.c +++ b/src/stasis/plugin_anastasis_postgres.c | |||
@@ -1915,11 +1915,9 @@ postgres_mark_challenge_code_satisfied ( | |||
1915 | const uint64_t code) | 1915 | const uint64_t code) |
1916 | { | 1916 | { |
1917 | struct PostgresClosure *pg = cls; | 1917 | struct PostgresClosure *pg = cls; |
1918 | struct GNUNET_TIME_Absolute now = GNUNET_TIME_absolute_get (); | ||
1919 | struct GNUNET_PQ_QueryParam params[] = { | 1918 | struct GNUNET_PQ_QueryParam params[] = { |
1920 | GNUNET_PQ_query_param_auto_from_type (truth_uuid), | 1919 | GNUNET_PQ_query_param_auto_from_type (truth_uuid), |
1921 | GNUNET_PQ_query_param_uint64 (&code), | 1920 | GNUNET_PQ_query_param_uint64 (&code), |
1922 | GNUNET_PQ_query_param_absolute_time (&now), | ||
1923 | GNUNET_PQ_query_param_end | 1921 | GNUNET_PQ_query_param_end |
1924 | }; | 1922 | }; |
1925 | 1923 | ||
@@ -2544,6 +2542,19 @@ libanastasis_plugin_db_postgres_init (void *cls) | |||
2544 | " AND expiration_date > $2" | 2542 | " AND expiration_date > $2" |
2545 | " AND retry_counter > 0;", | 2543 | " AND retry_counter > 0;", |
2546 | 2), | 2544 | 2), |
2545 | GNUNET_PQ_make_prepare ("challengecode_set_satisfied", | ||
2546 | "UPDATE anastasis_challengecode" | ||
2547 | " SET satisfied=TRUE" | ||
2548 | " WHERE truth_uuid=$1" | ||
2549 | " AND code=$2" | ||
2550 | " AND creation_date IN" | ||
2551 | " (SELECT creation_date" | ||
2552 | " FROM anastasis_challengecode" | ||
2553 | " WHERE truth_uuid=$1" | ||
2554 | " AND code=$2" | ||
2555 | " ORDER BY creation_date DESC" | ||
2556 | " LIMIT 1);", | ||
2557 | 2), | ||
2547 | GNUNET_PQ_make_prepare ("challengecode_select_meta", | 2558 | GNUNET_PQ_make_prepare ("challengecode_select_meta", |
2548 | "SELECT " | 2559 | "SELECT " |
2549 | " code" | 2560 | " code" |