aboutsummaryrefslogtreecommitdiff
path: root/src/exchangedb/pg_select_aggregations_above_serial.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/exchangedb/pg_select_aggregations_above_serial.c')
-rw-r--r--src/exchangedb/pg_select_aggregations_above_serial.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/exchangedb/pg_select_aggregations_above_serial.c b/src/exchangedb/pg_select_aggregations_above_serial.c
index 52d202702..56f99b022 100644
--- a/src/exchangedb/pg_select_aggregations_above_serial.c
+++ b/src/exchangedb/pg_select_aggregations_above_serial.c
@@ -1,6 +1,6 @@
/*
This file is part of TALER
- Copyright (C) 2023 Taler Systems SA
+ Copyright (C) 2023, 2024 Taler Systems SA
TALER is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
@@ -67,12 +67,16 @@ aggregation_serial_helper_cb (void *cls,
unsigned int num_results)
{
struct AggregationSerialContext *dsc = cls;
+ struct PostgresClosure *pg = dsc->pg;
for (unsigned int i = 0; i<num_results; i++)
{
uint64_t tracking_rowid;
uint64_t batch_deposit_serial_id;
+ struct TALER_Amount amount;
struct GNUNET_PQ_ResultSpec rs[] = {
+ TALER_PQ_RESULT_SPEC_AMOUNT ("total_amount",
+ &amount),
GNUNET_PQ_result_spec_uint64 ("aggregation_serial_id",
&tracking_rowid),
GNUNET_PQ_result_spec_uint64 ("batch_deposit_serial_id",
@@ -90,6 +94,7 @@ aggregation_serial_helper_cb (void *cls,
return;
}
dsc->cb (dsc->cb_cls,
+ &amount,
tracking_rowid,
batch_deposit_serial_id);
GNUNET_PQ_cleanup_result (rs);
@@ -123,9 +128,8 @@ TEH_PG_select_aggregations_above_serial (
"SELECT"
" aggregation_serial_id"
",batch_deposit_serial_id"
- " FROM aggregation_tracking"
- " WHERE aggregation_serial_id>=$1"
- " ORDER BY aggregation_serial_id ASC;");
+ ",total_amount"
+ " FROM exchange_do_select_aggregations_above_serial($1);");
qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn,
"select_aggregations_above_serial",
params,