gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] branch master updated: report cases of missing denomina


From: gnunet
Subject: [taler-exchange] branch master updated: report cases of missing denomination keys more nicely
Date: Tue, 24 Dec 2019 16:04:32 +0100

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

grothoff pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new 1970b768 report cases of missing denomination keys more nicely
1970b768 is described below

commit 1970b7687c5f64a7b6b2f1de69c6d62e78d7b4e1
Author: Christian Grothoff <address@hidden>
AuthorDate: Tue Dec 24 16:04:30 2019 +0100

    report cases of missing denomination keys more nicely
---
 src/auditor/taler-auditor.c | 54 ++++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 51 insertions(+), 3 deletions(-)

diff --git a/src/auditor/taler-auditor.c b/src/auditor/taler-auditor.c
index 5c28daa0..99c62113 100644
--- a/src/auditor/taler-auditor.c
+++ b/src/auditor/taler-auditor.c
@@ -3596,10 +3596,17 @@ withdraw_cb (void *cls,
   qs = get_denomination_info (denom_pub,
                               &issue,
                               &dh);
+  if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == qs)
+  {
+    report_row_inconsistency ("withdraw",
+                              rowid,
+                              "denomination key not found (foreign key 
constraint violated)");
+    cc->qs = GNUNET_DB_STATUS_HARD_ERROR;
+    return GNUNET_OK;
+  }
   if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT != qs)
   {
-    /* The key not existing should be prevented by foreign key constraints,
-       so must be a transient DB error. */
+    /* This really ought to be a transient DB error. */
     GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qs);
     cc->qs = qs;
     return GNUNET_SYSERR;
@@ -3803,6 +3810,14 @@ refresh_session_cb (void *cls,
   qs = get_denomination_info (denom_pub,
                               &issue,
                               NULL);
+  if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == qs)
+  {
+    report_row_inconsistency ("refresh_melt",
+                              rowid,
+                              "denomination key not found (foreign key 
constraint violated)");
+    cc->qs = GNUNET_DB_STATUS_HARD_ERROR;
+    return GNUNET_OK;
+  }
   if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT != qs)
   {
     GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qs);
@@ -3904,7 +3919,15 @@ refresh_session_cb (void *cls,
         qs = get_denomination_info (&reveal_ctx.new_dps[i],
                                     &new_issues[i],
                                     NULL);
-        if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT != qs)
+        if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == qs)
+        {
+          report_row_inconsistency ("refresh_reveal",
+                                    rowid,
+                                    "denomination key not found (foreign key 
constraint violated)");
+          cc->qs = GNUNET_DB_STATUS_HARD_ERROR;
+          err = GNUNET_YES;
+        }
+        else if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT != qs)
         {
           GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qs);
           cc->qs = qs;
@@ -4164,6 +4187,15 @@ deposit_cb (void *cls,
   qs = get_denomination_info (denom_pub,
                               &issue,
                               NULL);
+  if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == qs)
+  {
+    report_row_inconsistency ("deposits",
+                              rowid,
+                              "denomination key not found (foreign key 
constraint violated)");
+    cc->qs = GNUNET_DB_STATUS_HARD_ERROR;
+    return GNUNET_SYSERR;
+  }
+
   if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT != qs)
   {
     GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qs);
@@ -4339,6 +4371,14 @@ refund_cb (void *cls,
   qs = get_denomination_info (denom_pub,
                               &issue,
                               NULL);
+  if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == qs)
+  {
+    report_row_inconsistency ("refunds",
+                              rowid,
+                              "denomination key not found (foreign key 
constraint violated)");
+    cc->qs = GNUNET_DB_STATUS_HARD_ERROR;
+    return GNUNET_SYSERR;
+  }
   if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT != qs)
   {
     GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qs);
@@ -4507,6 +4547,14 @@ check_payback (struct CoinContext *cc,
   qs = get_denomination_info (denom_pub,
                               &issue,
                               &pr.h_denom_pub);
+  if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == qs)
+  {
+    report_row_inconsistency ("payback",
+                              rowid,
+                              "denomination key not found (foreign key 
constraint violated)");
+    cc->qs = GNUNET_DB_STATUS_HARD_ERROR;
+    return GNUNET_SYSERR;
+  }
   if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT != qs)
   {
     /* The key not existing should be prevented by foreign key constraints,

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

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