diff options
author | Christian Grothoff <christian@grothoff.org> | 2023-09-19 13:11:26 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2023-09-19 13:11:26 +0200 |
commit | 2f7f82536d53cf015f46782c1a81280849fef935 (patch) | |
tree | b7736dbcaccfda35c52a894c56447b61b31a3084 /src/include | |
parent | 2afcc8c70202c10b71f98c9e4b9766ae08656459 (diff) | |
download | exchange-2f7f82536d53cf015f46782c1a81280849fef935.tar.xz |
work on reserve history API
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/taler_exchange_service.h | 14 | ||||
-rw-r--r-- | src/include/taler_exchangedb_plugin.h | 12 |
2 files changed, 17 insertions, 9 deletions
diff --git a/src/include/taler_exchange_service.h b/src/include/taler_exchange_service.h index f973cfb0d..c344a93ae 100644 --- a/src/include/taler_exchange_service.h +++ b/src/include/taler_exchange_service.h @@ -1649,13 +1649,6 @@ struct TALER_EXCHANGE_ReserveHistoryEntry struct TALER_Amount amount; /** - * Index of this entry in the reserve history. - * Useful to filter requests by starting offset. - * Offsets are not necessarily contiguous. - */ - uint64_t entry_off; - - /** * Details depending on @e type. */ union @@ -2064,6 +2057,13 @@ struct TALER_EXCHANGE_ReserveHistory struct TALER_Amount total_out; /** + * Current etag / last entry in the history. + * Useful to filter requests by starting offset. + * Offsets are not necessarily contiguous. + */ + uint64_t etag; + + /** * Reserve history. */ const struct TALER_EXCHANGE_ReserveHistoryEntry *history; diff --git a/src/include/taler_exchangedb_plugin.h b/src/include/taler_exchangedb_plugin.h index fc11a292f..484b1155e 100644 --- a/src/include/taler_exchangedb_plugin.h +++ b/src/include/taler_exchangedb_plugin.h @@ -4221,12 +4221,18 @@ struct TALER_EXCHANGEDB_Plugin /** - * Get all of the transaction history associated with the specified - * reserve. + * Compile a list of (historic) transactions performed with the given reserve + * (withdraw, incoming wire, open, close operations). Should return 0 if the @a + * reserve_pub is unknown, otherwise determine @a etag_out and if it is past @a + * etag_in return the history after @a start_off. @a etag_out should be set + * to the last row ID of the given @a reserve_pub in the reserve history table. * * @param cls the @e cls of this struct with the plugin-specific state * @param reserve_pub public key of the reserve * @param start_off maximum starting offset in history to exclude from returning + * @param etag_in up to this offset the client already has a response, do not + * return anything unless @a etag_out will be larger + * @param[out] etag_out set to the latest history offset known for this @a coin_pub * @param[out] balance set to the reserve balance * @param[out] rhp set to known transaction history (NULL if reserve is unknown) * @return transaction status @@ -4235,6 +4241,8 @@ struct TALER_EXCHANGEDB_Plugin (*get_reserve_history)(void *cls, const struct TALER_ReservePublicKeyP *reserve_pub, uint64_t start_off, + uint64_t etag_in, + uint64_t *etag_out, struct TALER_Amount *balance, struct TALER_EXCHANGEDB_ReserveHistory **rhp); |