summaryrefslogtreecommitdiff
path: root/src/exchange/taler-exchange-aggregator.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-03-03 23:52:08 +0100
committerChristian Grothoff <christian@grothoff.org>2022-03-03 23:52:08 +0100
commit1643b745af309f754959621fa2a631c899ba1975 (patch)
tree19d6252ad82a78e432b8c969b948a7e0cb36c33b /src/exchange/taler-exchange-aggregator.c
parentf951cdef8ced141326887c1a996e8546774514f6 (diff)
downloadexchange-1643b745af309f754959621fa2a631c899ba1975.tar.gz
exchange-1643b745af309f754959621fa2a631c899ba1975.tar.bz2
exchange-1643b745af309f754959621fa2a631c899ba1975.zip
use 32 byte hash for hpayto, use that for joins on queries to better align queries with partitions
Diffstat (limited to 'src/exchange/taler-exchange-aggregator.c')
-rw-r--r--src/exchange/taler-exchange-aggregator.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/exchange/taler-exchange-aggregator.c b/src/exchange/taler-exchange-aggregator.c
index 58bf20738..40653f9b9 100644
--- a/src/exchange/taler-exchange-aggregator.c
+++ b/src/exchange/taler-exchange-aggregator.c
@@ -81,6 +81,11 @@ struct AggregationUnit
/**
* Selected wire target for the aggregation.
*/
+ struct TALER_PaytoHashP h_payto;
+
+ /**
+ * Serial number of the wire target.
+ */
uint64_t wire_target;
/**
@@ -426,6 +431,8 @@ deposit_cb (void *cls,
GNUNET_assert (NULL == au->payto_uri);
au->payto_uri = GNUNET_strdup (payto_uri);
+ TALER_payto_hash (payto_uri,
+ &au->h_payto);
au->wire_target = wire_target;
GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_NONCE,
&au->wtid,
@@ -775,7 +782,7 @@ run_aggregation (void *cls)
TALER_B2S (&au_active.merchant_pub),
(unsigned long long) au_active.wire_target);
qs = db_plugin->iterate_matching_deposits (db_plugin->cls,
- au_active.wire_target,
+ &au_active.h_payto,
&au_active.merchant_pub,
&aggregate_cb,
&au_active,
@@ -918,7 +925,7 @@ run_aggregation (void *cls)
qs = db_plugin->store_wire_transfer_out (db_plugin->cls,
au_active.execution_time,
&au_active.wtid,
- au_active.wire_target,
+ &au_active.h_payto,
au_active.wa->section_name,
&au_active.final_amount);
cleanup_au (&au_active);