aboutsummaryrefslogtreecommitdiff
path: root/src/mintdb/perf_taler_mintdb_init.c
diff options
context:
space:
mode:
authorFournier Nicolas <nicolas.fournier@ensta-paristech.fr>2015-08-17 10:56:56 +0200
committerFournier Nicolas <nicolas.fournier@ensta-paristech.fr>2015-08-17 10:56:56 +0200
commit0a1491562c846ce5b2a6b5861f3d3dc8a08972a5 (patch)
tree60423e0b05d01ea581cdb535594c99f241231acb /src/mintdb/perf_taler_mintdb_init.c
parent8e6f121a68c00cb6bdf9d160164684446af6d6c2 (diff)
preliminary work on more benchmarks
Diffstat (limited to 'src/mintdb/perf_taler_mintdb_init.c')
-rw-r--r--src/mintdb/perf_taler_mintdb_init.c42
1 files changed, 36 insertions, 6 deletions
diff --git a/src/mintdb/perf_taler_mintdb_init.c b/src/mintdb/perf_taler_mintdb_init.c
index d3741d5a7..27b29a669 100644
--- a/src/mintdb/perf_taler_mintdb_init.c
+++ b/src/mintdb/perf_taler_mintdb_init.c
@@ -565,24 +565,54 @@ struct TALER_MINTDB_RefreshCommitCoin *
PERF_TALER_MINTDB_refresh_commit_coin_init ()
{
struct TALER_MINTDB_RefreshCommitCoin *commit_coin;
- struct TALER_RefreshLinkEncrypted *refresh_link;
+ struct TALER_RefreshLinkEncrypted refresh_link;
commit_coin = GNUNET_new (struct TALER_MINTDB_RefreshCommitCoin);
GNUNET_assert (NULL != commit_coin);
{/* refresh_link */
- refresh_link = GNUNET_new (struct TALER_RefreshLinkEncrypted);
- *refresh_link = (struct TALER_RefreshLinkEncrypted)
+ refresh_link = (struct TALER_RefreshLinkEncrypted)
{
.blinding_key_enc = "blinding_key",
.blinding_key_enc_size = 13
};
- refresh_link->blinding_key_enc_size = 32;
GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK,
- &refresh_link->coin_priv_enc,
+ &refresh_link.coin_priv_enc,
sizeof(struct TALER_CoinSpendPrivateKeyP));
}
commit_coin->coin_ev = "coin_ev";
commit_coin->coin_ev_size = 8;
- commit_coin->refresh_link = refresh_link;
+ commit_coin->refresh_link = GNUNET_new (struct TALER_RefreshLinkEncrypted);
+ *commit_coin->refresh_link = refresh_link;
return commit_coin;
}
+
+
+/**
+ * Copies a #TALER_MINTDB_RefreshCommitCoin
+ *
+ * @param commit_coin the commit to copy
+ * @return a copy of @a commit_coin
+ */
+struct TALER_MINTDB_RefreshCommitCoin *
+PERF_TALER_MINTDB_refresh_commit_coin_copy (struct TALER_MINTDB_RefreshCommitCoin *commit_coin)
+{
+ struct TALER_MINTDB_RefreshCommitCoin *copy;
+
+ copy = GNUNET_new (struct TALER_MINTDB_RefreshCommitCoin);
+ copy->refresh_link = GNUNET_new (struct TALER_RefreshLinkEncrypted);
+ *copy->refresh_link = *commit_coin->refresh_link;
+ return copy;
+}
+
+
+/**
+ * Free a #TALER_MINTDB_RefreshCommitCoin
+ *
+ * @param commit_coin the coin to free
+ */
+void
+PERF_TALER_MINTDB_refresh_commit_coin_free (struct TALER_MINTDB_RefreshCommitCoin *commit_coin)
+{
+ GNUNET_free (commit_coin->refresh_link);
+ GNUNET_free (commit_coin);
+}