summaryrefslogtreecommitdiff
path: root/src/auditor/taler-helper-auditor-coins.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-12-25 13:56:33 +0100
committerChristian Grothoff <christian@grothoff.org>2021-12-25 13:56:40 +0100
commit87376e02eba3f5c2cf83a493446dee0c300565a4 (patch)
tree18103edb2bdf2b29a773cce2de596b06d8265abb /src/auditor/taler-helper-auditor-coins.c
parent2c14d338704f4574055c4b5c51d8a79dd2e22345 (diff)
downloadexchange-87376e02eba3f5c2cf83a493446dee0c300565a4.tar.gz
exchange-87376e02eba3f5c2cf83a493446dee0c300565a4.tar.bz2
exchange-87376e02eba3f5c2cf83a493446dee0c300565a4.zip
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/taler-helper-auditor-coins.c')
-rw-r--r--src/auditor/taler-helper-auditor-coins.c27
1 files changed, 10 insertions, 17 deletions
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,