From 81fec09268d08762e85583650d7bd02fdd7e7de4 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 8 Jul 2020 12:35:01 +0200 Subject: simplify DB access: do not fetch fields we do not need --- src/include/taler_exchangedb_plugin.h | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'src/include/taler_exchangedb_plugin.h') diff --git a/src/include/taler_exchangedb_plugin.h b/src/include/taler_exchangedb_plugin.h index 9fb932362..d069bd2ec 100644 --- a/src/include/taler_exchangedb_plugin.h +++ b/src/include/taler_exchangedb_plugin.h @@ -968,6 +968,29 @@ struct TALER_EXCHANGEDB_TransactionList struct TALER_EXCHANGEDB_Session; +/** + * Function called with details about deposits that have been made, + * with the goal of executing the corresponding wire transaction. + * + * @param cls closure + * @param rowid unique ID for the deposit in our DB, used for marking + * it as 'tiny' or 'done' + * @param coin_pub public key of the coin + * @param amount_with_fee amount that was deposited including fee + * @param deposit_fee amount the exchange gets to keep as transaction fees + * @param h_contract_terms hash of the proposal data known to merchant and customer + * @return transaction status code, #GNUNET_DB_STATUS_SUCCESS_ONE_RESULT to continue to iterate + */ +typedef enum GNUNET_DB_QueryStatus +(*TALER_EXCHANGEDB_MatchingDepositIterator)( + void *cls, + uint64_t rowid, + const struct TALER_CoinSpendPublicKeyP *coin_pub, + const struct TALER_Amount *amount_with_fee, + const struct TALER_Amount *deposit_fee, + const struct GNUNET_HashCode *h_contract_terms); + + /** * Function called with details about deposits that have been made, * with the goal of executing the corresponding wire transaction. @@ -985,7 +1008,7 @@ struct TALER_EXCHANGEDB_Session; * @param wire_deadline by which the merchant advised that he would like the * wire transfer to be executed * @param receiver_wire_account wire details for the merchant, includes - * 'url' in payto://-format; NULL from iterate_matching_deposits() + * 'url' in payto://-format; * @return transaction status code, #GNUNET_DB_STATUS_SUCCESS_ONE_RESULT to continue to iterate */ typedef enum GNUNET_DB_QueryStatus @@ -2019,7 +2042,7 @@ struct TALER_EXCHANGEDB_Plugin struct TALER_EXCHANGEDB_Session *session, const struct GNUNET_HashCode *h_wire, const struct TALER_MerchantPublicKeyP *merchant_pub, - TALER_EXCHANGEDB_DepositIterator deposit_cb, + TALER_EXCHANGEDB_MatchingDepositIterator deposit_cb, void *deposit_cb_cls, uint32_t limit); -- cgit v1.2.3