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/exchange/taler-exchange-aggregator.c | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) (limited to 'src/exchange') diff --git a/src/exchange/taler-exchange-aggregator.c b/src/exchange/taler-exchange-aggregator.c index 69c73746c..270a13301 100644 --- a/src/exchange/taler-exchange-aggregator.c +++ b/src/exchange/taler-exchange-aggregator.c @@ -507,44 +507,24 @@ deposit_cb (void *cls, * * @param cls a `struct AggregationUnit` * @param row_id identifies database entry - * @param exchange_timestamp when did the exchange receive the deposit - * @param wallet_timestamp when did the wallet sign the contract - * @param merchant_pub public key of the merchant * @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 - * @param wire_deadline by which the merchant advised that he would like the - * wire transfer to be executed - * @param wire wire details for the merchant * @return transaction status code */ static enum GNUNET_DB_QueryStatus aggregate_cb (void *cls, uint64_t row_id, - struct GNUNET_TIME_Absolute exchange_timestamp, - struct GNUNET_TIME_Absolute wallet_timestamp, - const struct TALER_MerchantPublicKeyP *merchant_pub, 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, - struct GNUNET_TIME_Absolute wire_deadline, - const json_t *wire) + const struct GNUNET_HashCode *h_contract_terms) { struct AggregationUnit *au = cls; struct TALER_Amount old; enum GNUNET_DB_QueryStatus qs; - /* NOTE: potential optimization: use custom SQL API to not - fetch these: */ - (void) wire_deadline; /* checked by SQL */ - (void) exchange_timestamp; - (void) wallet_timestamp; - (void) wire; /* must match */ - GNUNET_break (0 == GNUNET_memcmp (&au->merchant_pub, - merchant_pub)); - if (au->rows_offset >= TALER_EXCHANGEDB_MATCHING_DEPOSITS_LIMIT) { /* Bug: we asked for at most #TALER_EXCHANGEDB_MATCHING_DEPOSITS_LIMIT results! */ -- cgit v1.2.3