gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] branch master updated: fix get_balance zeroing


From: gnunet
Subject: [taler-exchange] branch master updated: fix get_balance zeroing
Date: Wed, 21 Aug 2024 17:56:21 +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 a3de445ab fix get_balance zeroing
a3de445ab is described below

commit a3de445abaac98b781f42c9b9e493bed3d53140d
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Wed Aug 21 17:56:16 2024 +0200

    fix get_balance zeroing
---
 src/auditordb/pg_get_balance.c | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/src/auditordb/pg_get_balance.c b/src/auditordb/pg_get_balance.c
index 7a0b7c38c..d7e1816d9 100644
--- a/src/auditordb/pg_get_balance.c
+++ b/src/auditordb/pg_get_balance.c
@@ -80,12 +80,13 @@ balance_cb (void *cls,
   GNUNET_assert (num_results <= ctx->len);
   for (unsigned int i = 0; i < num_results; i++)
   {
+    bool is_missing;
     struct GNUNET_PQ_ResultSpec rs[] = {
       GNUNET_PQ_result_spec_allow_null (
         TALER_PQ_result_spec_amount ("balance",
                                      pg->currency,
                                      ctx->dst[i]),
-        NULL),
+        &is_missing),
       GNUNET_PQ_result_spec_end
     };
 
@@ -98,6 +99,12 @@ balance_cb (void *cls,
       ctx->failure = true;
       return;
     }
+    if (is_missing)
+    {
+      GNUNET_assert (GNUNET_OK ==
+                     TALER_amount_set_zero (pg->currency,
+                                            ctx->dst[i]));
+    }
     ctx->off++;
   }
 }
@@ -113,6 +120,9 @@ TAH_PG_get_balance (void *cls,
   unsigned int cnt = 1;
   va_list ap;
 
+  GNUNET_assert (GNUNET_OK ==
+                 TALER_amount_set_zero (pg->currency,
+                                        balance_value));
   va_start (ap,
             balance_value);
   while (NULL != va_arg (ap,
@@ -123,8 +133,9 @@ TAH_PG_get_balance (void *cls,
     cnt++;
     dst = va_arg (ap,
                   struct TALER_Amount *);
-    TALER_amount_set_zero (pg->currency,
-                           dst);
+    GNUNET_assert (GNUNET_OK ==
+                   TALER_amount_set_zero (pg->currency,
+                                          dst));
   }
   va_end (ap);
   {

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