diff options
author | Christian Grothoff <christian@grothoff.org> | 2018-10-28 11:30:02 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2018-10-28 11:30:02 +0100 |
commit | bd40aad7dc22c9f5d723f82384c5d57204205b7a (patch) | |
tree | 1a2c4433d8781c2b2f7f8d3ea28f22234784b624 /src/auditor | |
parent | fb0d7110e80546f77d8c562ecfeb2ae06e2f4b6b (diff) | |
download | exchange-bd40aad7dc22c9f5d723f82384c5d57204205b7a.tar.xz |
track number of coins issued per denomination in auditor (not yet used)
Diffstat (limited to 'src/auditor')
-rw-r--r-- | src/auditor/taler-auditor.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/src/auditor/taler-auditor.c b/src/auditor/taler-auditor.c index 12ababc55..8c13e45d5 100644 --- a/src/auditor/taler-auditor.c +++ b/src/auditor/taler-auditor.c @@ -2754,6 +2754,12 @@ struct DenominationSummary struct TALER_Amount denom_risk; /** + * How many coins (not their amount!) of this denomination + * did the exchange issue overall? + */ + uint64_t num_issued; + + /** * Denomination key information for this denomination. */ const struct TALER_EXCHANGEDB_DenominationKeyInformationP *dki; @@ -2805,10 +2811,11 @@ init_denomination (const struct GNUNET_HashCode *denom_hash, enum GNUNET_DB_QueryStatus qs; qs = adb->get_denomination_balance (adb->cls, - asession, - denom_hash, - &ds->denom_balance, - &ds->denom_risk); + asession, + denom_hash, + &ds->denom_balance, + &ds->denom_risk, + &ds->num_issued); if (0 > qs) { GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qs); @@ -2964,13 +2971,15 @@ sync_denomination (void *cls, asession, denom_hash, &ds->denom_balance, - &ds->denom_risk); + &ds->denom_risk, + ds->num_issued); else qs = adb->insert_denomination_balance (adb->cls, asession, denom_hash, &ds->denom_balance, - &ds->denom_risk); + &ds->denom_risk, + ds->num_issued); } if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT != qs) { @@ -3051,6 +3060,7 @@ withdraw_cb (void *cls, "Issued coin in denomination `%s' of total value %s\n", GNUNET_h2s (&dh), TALER_amount2s (&value)); + ds->num_issued++; if (GNUNET_OK != TALER_amount_add (&ds->denom_balance, &ds->denom_balance, @@ -3367,6 +3377,7 @@ refresh_session_cb (void *cls, "Created fresh coin in denomination `%s' of value %s\n", GNUNET_h2s (&new_dkis[i]->properties.denom_hash), TALER_amount2s (&value)); + dsi->num_issued++; if (GNUNET_OK != TALER_amount_add (&dsi->denom_balance, &dsi->denom_balance, |