exchange

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

commit 7011826dbe571327324c1a7b6a5259aa26da6bbe
parent b51962715356a6783e02d07c292c262a35919281
Author: Christian Grothoff <christian@grothoff.org>
Date:   Tue,  7 Apr 2026 10:41:30 +0200

return history_offset also in C API

Diffstat:
Msrc/include/taler/taler-exchange/get-reserves-RESERVE_PUB-history.h | 7+++++++
Msrc/lib/exchange_api_get-reserves-RESERVE_PUB-history.c | 8++++----
2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/src/include/taler/taler-exchange/get-reserves-RESERVE_PUB-history.h b/src/include/taler/taler-exchange/get-reserves-RESERVE_PUB-history.h @@ -80,6 +80,13 @@ struct TALER_EXCHANGE_ReserveHistoryEntry enum TALER_EXCHANGE_ReserveTransactionType type; /** + * Offset of this entry in the reserve history. + * Useful to request incremental histories via + * the "start" query parameter. + */ + uint64_t history_offset; + + /** * Amount transferred (in or out). */ struct TALER_Amount amount; diff --git a/src/lib/exchange_api_get-reserves-RESERVE_PUB-history.c b/src/lib/exchange_api_get-reserves-RESERVE_PUB-history.c @@ -872,13 +872,14 @@ parse_reserve_history ( { struct TALER_EXCHANGE_ReserveHistoryEntry *rh = &rhistory[off]; json_t *transaction; - struct TALER_Amount amount; const char *type; struct GNUNET_JSON_Specification hist_spec[] = { GNUNET_JSON_spec_string ("type", &type), TALER_JSON_spec_amount_any ("amount", - &amount), + &rh->amount), + GNUNET_JSON_spec_uint64 ("history_offset", + &rh->history_offset), /* 'wire' and 'signature' are optional depending on 'type'! */ GNUNET_JSON_spec_end () }; @@ -897,9 +898,8 @@ parse_reserve_history ( JSON_INDENT (2)); return GNUNET_SYSERR; } - rh->amount = amount; if (GNUNET_YES != - TALER_amount_cmp_currency (&amount, + TALER_amount_cmp_currency (&rh->amount, total_in)) { GNUNET_break_op (0);