gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-exchange] branch master updated: handle payback case


From: gnunet
Subject: [GNUnet-SVN] [taler-exchange] branch master updated: handle payback cases when processing coin history in auditor
Date: Fri, 26 Jul 2019 22:03:18 +0200

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 19c4feda handle payback cases when processing coin history in auditor
19c4feda is described below

commit 19c4feda562ca09ecef5c79d29fae36169ea9900
Author: Christian Grothoff <address@hidden>
AuthorDate: Fri Jul 26 22:03:15 2019 +0200

    handle payback cases when processing coin history in auditor
---
 src/auditor/taler-auditor.c | 35 +++++++++++++++++++++++++++++++----
 1 file changed, 31 insertions(+), 4 deletions(-)

diff --git a/src/auditor/taler-auditor.c b/src/auditor/taler-auditor.c
index 6b46faea..a63ac8bd 100644
--- a/src/auditor/taler-auditor.c
+++ b/src/auditor/taler-auditor.c
@@ -1,6 +1,6 @@
 /*
   This file is part of TALER
-  Copyright (C) 2016, 2017, 2018 Taler Systems SA
+  Copyright (C) 2016, 2017, 2018, 2019 Taler Systems SA
 
   TALER is free software; you can redistribute it and/or modify it under the
   terms of the GNU Affero Public License as published by the Free Software
@@ -26,8 +26,6 @@
  *
  *
  * KNOWN BUGS:
- * - TT_PAYBACK cases should be checked in check_transaction_history (and
- *   maybe other places?)
  * - we also seem to nowhere check the denomination signatures over the coins
  *   (While as the exchange could easily falsify those, we should
  *    probably check as otherwise insider *without* RSA private key
@@ -2127,6 +2125,17 @@ check_transaction_history (const struct 
TALER_CoinSpendPublicKeyP *coin_pub,
         return GNUNET_SYSERR;
       }
       break;
+    case TALER_EXCHANGEDB_TT_OLD_COIN_PAYBACK:
+      amount_with_fee = &tl->details.old_coin_payback->value;
+      if (GNUNET_OK !=
+          TALER_amount_add (&refunds,
+                            &refunds,
+                            amount_with_fee))
+      {
+        GNUNET_break (0);
+        return GNUNET_SYSERR;
+      }
+      break;
     case TALER_EXCHANGEDB_TT_PAYBACK:
       amount_with_fee = &tl->details.payback->value;
       if (GNUNET_OK !=
@@ -2138,6 +2147,17 @@ check_transaction_history (const struct 
TALER_CoinSpendPublicKeyP *coin_pub,
         return GNUNET_SYSERR;
       }
       break;
+    case TALER_EXCHANGEDB_TT_PAYBACK_REFRESH:
+      amount_with_fee = &tl->details.payback_refresh->value;
+      if (GNUNET_OK !=
+          TALER_amount_add (&expenditures,
+                            &expenditures,
+                            amount_with_fee))
+      {
+        GNUNET_break (0);
+        return GNUNET_SYSERR;
+      }
+      break;
     }
   } /* for 'tl' */
 
@@ -2152,7 +2172,8 @@ check_transaction_history (const struct 
TALER_CoinSpendPublicKeyP *coin_pub,
                                      deposit_fee));
   }
 
-  /* Calculate total balance change, i.e. expenditures minus refunds */
+  /* Calculate total balance change, i.e. expenditures (payback, deposit, 
refresh)
+     minus refunds (refunds, payback-to-old) */
   if (GNUNET_SYSERR ==
       TALER_amount_subtract (&spent,
                              &expenditures,
@@ -2294,9 +2315,15 @@ wire_transfer_information_cb (void *cls,
   case TALER_EXCHANGEDB_TT_REFUND:
     coin = &tl->details.refund->coin;
     break;
+  case TALER_EXCHANGEDB_TT_OLD_COIN_PAYBACK:
+    coin = &tl->details.payback_refresh->coin;
+    break;
   case TALER_EXCHANGEDB_TT_PAYBACK:
     coin = &tl->details.payback->coin;
     break;
+  case TALER_EXCHANGEDB_TT_PAYBACK_REFRESH:
+    coin = &tl->details.payback_refresh->coin;
+    break;
   }
   GNUNET_assert (NULL != coin); /* hard check that switch worked */
   qs = get_denomination_info_by_hash (&coin->denom_pub_hash,

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



reply via email to

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