gnunet-svn
[Top][All Lists]
Advanced

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

[taler-merchant] 163/277: implement filter


From: gnunet
Subject: [taler-merchant] 163/277: implement filter
Date: Sun, 05 Jul 2020 20:51:16 +0200

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

grothoff pushed a commit to branch master
in repository merchant.

commit 6f11901485a5af44c53a31ebbf4d0e93991983c9
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Sun May 31 20:55:02 2020 +0200

    implement filter
---
 src/backenddb/plugin_merchantdb_postgres.c | 31 ++++++++++++++++++++++++++++--
 1 file changed, 29 insertions(+), 2 deletions(-)

diff --git a/src/backenddb/plugin_merchantdb_postgres.c 
b/src/backenddb/plugin_merchantdb_postgres.c
index 690f484..eba525b 100644
--- a/src/backenddb/plugin_merchantdb_postgres.c
+++ b/src/backenddb/plugin_merchantdb_postgres.c
@@ -3840,12 +3840,13 @@ struct LookupReservesContext
   void *cb_cls;
 
   /**
-   *
+   * Filter by active reserves.
    */
   enum TALER_MERCHANTDB_YesNoAll active;
 
   /**
-   *
+   * Filter by failures (missmatch in exchange claimed and
+   * merchant claimed initial amounts).
    */
   enum TALER_MERCHANTDB_YesNoAll failures;
 
@@ -3912,6 +3913,32 @@ lookup_reserves_cb (void *cls,
       lrc->qs = GNUNET_DB_STATUS_HARD_ERROR;
       return;
     }
+    switch (lrc->active)
+    {
+    case TALER_MERCHANTDB_YNA_YES:
+      if (! active)
+        continue;
+    case TALER_MERCHANTDB_YNA_NO:
+      if (active)
+        continue;
+    case TALER_MERCHANTDB_YNA_ALL:
+      break;
+    }
+    switch (lrc->failures)
+    {
+    case TALER_MERCHANTDB_YNA_YES:
+      if (0 ==
+          TALER_amount_cmp (&merchant_initial_balance,
+                            &exchange_initial_balance))
+        continue;
+    case TALER_MERCHANTDB_YNA_NO:
+      if (0 !=
+          TALER_amount_cmp (&merchant_initial_balance,
+                            &exchange_initial_balance))
+        continue;
+    case TALER_MERCHANTDB_YNA_ALL:
+      break;
+    }
     lrc->cb (lrc->cb_cls,
              &reserve_pub,
              creation_time,

-- 
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]