exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

commit ff7a57feb809de2144396d95ec49499db48af14b
parent 3eac209f2c15207bd3edd83ecfcab53326dad3eb
Author: Christian Grothoff <christian@grothoff.org>
Date:   Tue,  7 Apr 2026 10:35:34 +0200

expose history_offset to client

Diffstat:
Msrc/exchangedb/pg_get_reserve_history.c | 10++++++++++
Msrc/include/taler/taler_exchangedb_plugin.h | 6++++++
2 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/src/exchangedb/pg_get_reserve_history.c b/src/exchangedb/pg_get_reserve_history.c @@ -74,6 +74,12 @@ struct ReserveHistoryContext struct TALER_Amount balance_out; /** + * Current reserve_history_serial_id being processed, + * set before each sub-table callback. + */ + uint64_t current_history_offset; + + /** * Set to true on serious internal errors during * the callbacks. */ @@ -94,6 +100,7 @@ append_rh (struct ReserveHistoryContext *rhc) struct TALER_EXCHANGEDB_ReserveHistory *tail; tail = GNUNET_new (struct TALER_EXCHANGEDB_ReserveHistory); + tail->history_offset = rhc->current_history_offset; if (NULL != rhc->rh_tail) { rhc->rh_tail->next = tail; @@ -667,6 +674,8 @@ handle_history_entry (void *cls, &table_name), GNUNET_PQ_result_spec_uint64 ("serial_id", &serial_id), + GNUNET_PQ_result_spec_uint64 ("reserve_history_serial_id", + &rhc->current_history_offset), GNUNET_PQ_result_spec_end }; struct GNUNET_PQ_QueryParam params[] = { @@ -778,6 +787,7 @@ TEH_PG_get_reserve_history ( "SELECT" " table_name" ",serial_id" + ",reserve_history_serial_id" " FROM reserve_history" " WHERE reserve_pub=$1" " AND reserve_history_serial_id > $2" diff --git a/src/include/taler/taler_exchangedb_plugin.h b/src/include/taler/taler_exchangedb_plugin.h @@ -1731,6 +1731,12 @@ struct TALER_EXCHANGEDB_ReserveHistory struct TALER_EXCHANGEDB_ReserveHistory *next; /** + * Offset of this entry in the reserve history. + * Corresponds to the reserve_history_serial_id in the database. + */ + uint64_t history_offset; + + /** * Type of the event, determines @e details. */ enum TALER_EXCHANGEDB_ReserveOperation type;