gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-anastasis] branch master updated: -modify backend to support new


From: gnunet
Subject: [taler-anastasis] branch master updated: -modify backend to support new truth validation flow
Date: Mon, 16 Aug 2021 21:34:17 +0200

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository anastasis.

The following commit(s) were added to refs/heads/master by this push:
     new 2a53e17  -modify backend to support new truth validation flow
2a53e17 is described below

commit 2a53e1758257b1af89e085511e4e7eba809ed84e
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Mon Aug 16 21:34:13 2021 +0200

    -modify backend to support new truth validation flow
---
 src/backend/anastasis-httpd_truth.c    | 12 ++++++++++++
 src/stasis/plugin_anastasis_postgres.c | 15 +++++++++++++--
 2 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/src/backend/anastasis-httpd_truth.c 
b/src/backend/anastasis-httpd_truth.c
index 0b0d22f..2c757db 100644
--- a/src/backend/anastasis-httpd_truth.c
+++ b/src/backend/anastasis-httpd_truth.c
@@ -961,6 +961,18 @@ run_authorization_process (struct MHD_Connection 
*connection,
     gc->authorization->cleanup (gc->as);
     gc->as = NULL;
     return MHD_NO;
+  case ANASTASIS_AUTHORIZATION_RES_FINISHED:
+    GNUNET_assert (! gc->suspended);
+    gc->authorization->cleanup (gc->as);
+    gc->as = NULL;
+    if (gc->in_list)
+    {
+      GNUNET_CONTAINER_DLL_remove (gc_head,
+                                   gc_tail,
+                                   gc);
+      gc->in_list = false;
+    }
+    return MHD_YES;
   }
   GNUNET_break (0);
   return MHD_NO;
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 (
   const uint64_t code)
 {
   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_end
   };
 
@@ -2544,6 +2542,19 @@ libanastasis_plugin_db_postgres_init (void *cls)
                             "   AND expiration_date > $2"
                             "   AND retry_counter > 0;",
                             2),
+    GNUNET_PQ_make_prepare ("challengecode_set_satisfied",
+                            "UPDATE anastasis_challengecode"
+                            " SET satisfied=TRUE"
+                            " WHERE truth_uuid=$1"
+                            "   AND code=$2"
+                            "   AND creation_date IN"
+                            " (SELECT creation_date"
+                            "    FROM anastasis_challengecode"
+                            "   WHERE truth_uuid=$1"
+                            "     AND code=$2"
+                            "    ORDER BY creation_date DESC"
+                            "     LIMIT 1);",
+                            2),
     GNUNET_PQ_make_prepare ("challengecode_select_meta",
                             "SELECT "
                             " code"

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]