diff options
author | Christian Grothoff <christian@grothoff.org> | 2021-12-25 13:56:33 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2021-12-25 13:56:40 +0100 |
commit | 87376e02eba3f5c2cf83a493446dee0c300565a4 (patch) | |
tree | 18103edb2bdf2b29a773cce2de596b06d8265abb /src/auditor | |
parent | 2c14d338704f4574055c4b5c51d8a79dd2e22345 (diff) | |
download | exchange-87376e02eba3f5c2cf83a493446dee0c300565a4.tar.xz |
protocol v12 changes (/recoup split, signature changes) plus database sharding plus O(n^2)=>O(n) worst-case complexity reduction on coin balance checks
Diffstat (limited to 'src/auditor')
-rw-r--r-- | src/auditor/taler-auditor-httpd_deposit-confirmation.c | 9 | ||||
-rw-r--r-- | src/auditor/taler-helper-auditor-coins.c | 27 |
2 files changed, 16 insertions, 20 deletions
diff --git a/src/auditor/taler-auditor-httpd_deposit-confirmation.c b/src/auditor/taler-auditor-httpd_deposit-confirmation.c index d2ab03705..694753c8d 100644 --- a/src/auditor/taler-auditor-httpd_deposit-confirmation.c +++ b/src/auditor/taler-auditor-httpd_deposit-confirmation.c @@ -341,9 +341,12 @@ TEAH_DEPOSIT_CONFIRMATION_init (void) void TEAH_DEPOSIT_CONFIRMATION_done (void) { - GNUNET_CONTAINER_multihashmap_destroy (cache); - cache = NULL; - GNUNET_assert (0 == pthread_mutex_destroy (&lock)); + if (NULL != cache) + { + GNUNET_CONTAINER_multihashmap_destroy (cache); + cache = NULL; + GNUNET_assert (0 == pthread_mutex_destroy (&lock)); + } } diff --git a/src/auditor/taler-helper-auditor-coins.c b/src/auditor/taler-helper-auditor-coins.c index 16d030b7f..0544edfbc 100644 --- a/src/auditor/taler-helper-auditor-coins.c +++ b/src/auditor/taler-helper-auditor-coins.c @@ -1093,19 +1093,10 @@ struct RevealContext static void reveal_data_cb (void *cls, uint32_t num_freshcoins, - const struct TALER_EXCHANGEDB_RefreshRevealedCoin *rrcs, - unsigned int num_tprivs, - const struct TALER_TransferPrivateKeyP *tprivs, - const struct TALER_TransferPublicKeyP *tp) + const struct TALER_EXCHANGEDB_RefreshRevealedCoin *rrcs) { struct RevealContext *rctx = cls; - /* Note: optimization using custom database accessor API could avoid - fetching these fields -- and we */ - (void) num_tprivs; - (void) tprivs; - (void) tp; - rctx->num_freshcoins = num_freshcoins; rctx->new_issues = GNUNET_new_array ( num_freshcoins, @@ -1117,9 +1108,8 @@ reveal_data_cb (void *cls, enum GNUNET_DB_QueryStatus qs; /* lookup new coin denomination key */ - qs = TALER_ARL_get_denomination_info (&rrcs[i].denom_pub, - &rctx->new_issues[i], - NULL); + qs = TALER_ARL_get_denomination_info_by_hash (&rrcs[i].h_denom_pub, + &rctx->new_issues[i]); if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == qs) { report_row_inconsistency ("refresh_reveal", @@ -1287,13 +1277,16 @@ refresh_session_cb (void *cls, /* verify melt signature */ { - const struct TALER_DenominationHash h_denom_pub; + struct TALER_DenominationHash h_denom_pub; + struct TALER_Amount fee_refresh; TALER_denom_pub_hash (denom_pub, - &rmc.h_denom_pub); + &h_denom_pub); + TALER_amount_ntoh (&fee_refresh, + &issue->fee_refresh); if (GNUNET_OK != - TALER_wallet_melt_verify (&rmc.amount_with_fee, - &issue->fee_refresh, + TALER_wallet_melt_verify (amount_with_fee, + &fee_refresh, rc, &h_denom_pub, coin_pub, |