aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2024-08-21 17:56:16 +0200
committerChristian Grothoff <christian@grothoff.org>2024-08-21 17:56:16 +0200
commita3de445abaac98b781f42c9b9e493bed3d53140d (patch)
treeda9783bdd882b5d312c921da64b6cc83357a7545
parentd2b7506b5cf5954304f3ae49a9ccea1f1bdd03cc (diff)
fix get_balance zeroing
-rw-r--r--src/auditordb/pg_get_balance.c17
1 files 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);
{