diff options
author | Marcello Stanisci <marcello.stanisci@inria.fr> | 2016-06-11 18:01:57 +0200 |
---|---|---|
committer | Marcello Stanisci <marcello.stanisci@inria.fr> | 2016-06-11 18:01:57 +0200 |
commit | 4f4bad310bc3c34029e7c7d51184c3a163882555 (patch) | |
tree | c86a2153d33326237bc39f8a6a92a8eda0509b5a /src/benchmark/taler-exchange-benchmark.c | |
parent | 6bd7d2fc851fa9731279d2b4881e0ce8f263a743 (diff) | |
download | exchange-4f4bad310bc3c34029e7c7d51184c3a163882555.tar.xz |
placing refreshed coins where all coins are
Diffstat (limited to 'src/benchmark/taler-exchange-benchmark.c')
-rw-r--r-- | src/benchmark/taler-exchange-benchmark.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/benchmark/taler-exchange-benchmark.c b/src/benchmark/taler-exchange-benchmark.c index 5dffe8a1a..761cc03bd 100644 --- a/src/benchmark/taler-exchange-benchmark.c +++ b/src/benchmark/taler-exchange-benchmark.c @@ -51,6 +51,14 @@ struct GNUNET_CONFIGURATION_Handle *cfg; static unsigned int nreserves; /** + * How many coins are in `coins` array. This is needed + * as the number of coins is not always nreserves * COINS_PER_RESERVE + * due to refresh operations + */ +unsigned int ncoins; + + +/** * Bank details of who creates reserves */ json_t *sender_details; @@ -425,10 +433,12 @@ reveal_cb (void *cls, GNUNET_free (refresh_denom); fresh_coin.pk = find_pk (keys, &amount); fresh_coin.sig = sigs[i]; + GNUNET_array_append (coins, ncoins, fresh_coin); + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "# of coins after refresh: %d\n", + ncoins); } - - - + GNUNET_free (rrcls); } /** @@ -768,7 +778,8 @@ benchmark_run (void *cls) reserves = GNUNET_new_array (nreserves, struct Reserve); - coins = GNUNET_new_array (COINS_PER_RESERVE * nreserves, + ncoins = COINS_PER_RESERVE * nreserves; + coins = GNUNET_new_array (ncoins, struct Coin); for (i=0;i < nreserves && 0 < nreserves;i++) |