exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

commit 4f4bad310bc3c34029e7c7d51184c3a163882555
parent 6bd7d2fc851fa9731279d2b4881e0ce8f263a743
Author: Marcello Stanisci <marcello.stanisci@inria.fr>
Date:   Sat, 11 Jun 2016 18:01:57 +0200

placing refreshed coins where all coins are

Diffstat:
Msrc/benchmark/taler-exchange-benchmark.c | 19+++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)

diff --git 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++)