gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] branch master updated: -fix balance calculation


From: gnunet
Subject: [taler-exchange] branch master updated: -fix balance calculation
Date: Mon, 06 Dec 2021 16:37:35 +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 7dcd217b -fix balance calculation
7dcd217b is described below

commit 7dcd217b60b1a5d64cda357473080970f57aeaab
Author: Christian Grothoff <grothoff@gnunet.org>
AuthorDate: Mon Dec 6 16:37:32 2021 +0100

    -fix balance calculation
---
 src/exchange/taler-exchange-httpd.c      | 4 ++--
 src/exchange/taler-exchange-httpd_keys.c | 4 ++--
 src/exchangedb/bench_db.c                | 6 +++---
 src/include/taler_extensions.h           | 5 +++--
 src/lib/exchange_api_common.c            | 9 ++++++---
 src/lib/exchange_api_deposit.c           | 4 ++--
 6 files changed, 18 insertions(+), 14 deletions(-)

diff --git a/src/exchange/taler-exchange-httpd.c 
b/src/exchange/taler-exchange-httpd.c
index b948c315..6bda5821 100644
--- a/src/exchange/taler-exchange-httpd.c
+++ b/src/exchange/taler-exchange-httpd.c
@@ -1866,8 +1866,8 @@ run (void *cls,
                           MHD_OPTION_CONNECTION_TIMEOUT,
                           connection_timeout,
                           (0 == allow_address_reuse)
-                            ? MHD_OPTION_END
-                            : MHD_OPTION_LISTENING_ADDRESS_REUSE,
+                          ? MHD_OPTION_END
+                          : MHD_OPTION_LISTENING_ADDRESS_REUSE,
                           (unsigned int) allow_address_reuse,
                           MHD_OPTION_END);
   if (NULL == mhd)
diff --git a/src/exchange/taler-exchange-httpd_keys.c 
b/src/exchange/taler-exchange-httpd_keys.c
index af9274c1..f722c16a 100644
--- a/src/exchange/taler-exchange-httpd_keys.c
+++ b/src/exchange/taler-exchange-httpd_keys.c
@@ -2390,8 +2390,8 @@ TEH_keys_get_handler (struct TEH_RequestContext *rc,
                                MHD_HTTP_OK,
                                (MHD_YES ==
                                 TALER_MHD_can_compress (rc->connection))
-       ? krd->response_compressed
-       : krd->response_uncompressed);
+                               ? krd->response_compressed
+                               : krd->response_uncompressed);
   }
 }
 
diff --git a/src/exchangedb/bench_db.c b/src/exchangedb/bench_db.c
index 1e95df27..a8dbfbfa 100644
--- a/src/exchangedb/bench_db.c
+++ b/src/exchangedb/bench_db.c
@@ -379,7 +379,7 @@ run (void *cls)
 
     j = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_NONCE,
                                   TOTAL);
-    if (! bm_select ((0 == f)? conn2 : conn,
+    if (! bm_select ((0 == f) ? conn2 : conn,
                      j))
     {
       GNUNET_PQ_disconnect (conn);
@@ -422,7 +422,7 @@ run (void *cls)
 
     j = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_NONCE,
                                   TOTAL);
-    if (! bhm_select ((0 == f)? conn2 : conn,
+    if (! bhm_select ((0 == f) ? conn2 : conn,
                       j))
     {
       GNUNET_PQ_disconnect (conn);
@@ -465,7 +465,7 @@ run (void *cls)
 
     j = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_NONCE,
                                   TOTAL);
-    if (! bem_select ((0 == f)? conn2 : conn,
+    if (! bem_select ((0 == f) ? conn2 : conn,
                       j))
     {
       GNUNET_PQ_disconnect (conn);
diff --git a/src/include/taler_extensions.h b/src/include/taler_extensions.h
index c4e9d1f5..b02edf68 100644
--- a/src/include/taler_extensions.h
+++ b/src/include/taler_extensions.h
@@ -46,8 +46,9 @@ enum TALER_EXTENSION_ReturnValue
  * The default age mask represents the age groups
  * 0-7, 8-9, 10-11, 12-13, 14-15, 16-17, 18-20, 21-...
  */
-#define TALER_EXTENSION_DEFAULT_AGE_MASK (1 | 1 << 8 | 1 << 10 | 1 << 12 | 1 
<< \
-                                          14 | 1 << 16 | 1 << 18 | 1 << 21)
+#define TALER_EXTENSION_DEFAULT_AGE_MASK (1 | 1 << 8 | 1 << 10 | 1 << 12 | 1   
 \
+                                                << 14 | 1 << 16 | 1 << 18 | 1 \
+                                                << 21)
 
 /**
  * @param groups String representation of age groups, like: 
"8:10:12:14:16:18:21"
diff --git a/src/lib/exchange_api_common.c b/src/lib/exchange_api_common.c
index c5cf4110..4f6588a2 100644
--- a/src/lib/exchange_api_common.c
+++ b/src/lib/exchange_api_common.c
@@ -767,6 +767,8 @@ TALER_EXCHANGE_verify_coin_history (
     else if (0 == strcasecmp (type,
                               "RECOUP-REFRESH"))
     {
+      /* This is the coin that was subjected to a recoup,
+         the value being credited to the old coin. */
       struct TALER_RecoupRefreshConfirmationPS pc = {
         .purpose.size = htonl (sizeof (pc)),
         .purpose.purpose = htonl (
@@ -831,12 +833,13 @@ TALER_EXCHANGE_verify_coin_history (
         return GNUNET_SYSERR;
       }
       *h_denom_pub = rr.h_denom_pub;
-      add = GNUNET_YES;  // FIXME: one of these should be a "NO"
-      // => need better tests!!!
+      add = GNUNET_YES;
     }
     else if (0 == strcasecmp (type,
                               "OLD-COIN-RECOUP"))
     {
+      /* This is the coin that was credited in a recoup,
+         the value being credited to the this coin. */
       struct TALER_RecoupRefreshConfirmationPS pc = {
         .purpose.size = htonl (sizeof (pc)),
         .purpose.purpose = htonl (
@@ -879,7 +882,7 @@ TALER_EXCHANGE_verify_coin_history (
         GNUNET_break_op (0);
         return GNUNET_SYSERR;
       }
-      add = GNUNET_YES; // FIXME: one of these should be a "NO"
+      add = GNUNET_NO;
     }
     else
     {
diff --git a/src/lib/exchange_api_deposit.c b/src/lib/exchange_api_deposit.c
index bb935514..8b93f56e 100644
--- a/src/lib/exchange_api_deposit.c
+++ b/src/lib/exchange_api_deposit.c
@@ -629,8 +629,8 @@ TALER_EXCHANGE_deposit (
                          &h_wire,
                          h_contract_terms,
                          (NULL != extension_details)
-                   ? &ech
-                   : NULL,
+                         ? &ech
+                         : NULL,
                          coin_pub,
                          denom_sig,
                          denom_pub,

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