commit fbaff3d2d537c36c9e2fe28f551855fc1ac036e1
parent f6026688d2c2d42f0c32ba59582213f70a276e2e
Author: Christian Grothoff <christian@grothoff.org>
Date: Tue, 27 May 2025 11:13:46 +0200
adapting taler-helper-auditor coins to new refresh (#9900); implementation done, testing is still TBD
Diffstat:
17 files changed, 253 insertions(+), 949 deletions(-)
diff --git a/src/auditor/Makefile.am b/src/auditor/Makefile.am
@@ -199,7 +199,6 @@ taler_auditor_httpd_SOURCES = \
taler-auditor-httpd_bad-sig-losses-get.c taler-auditor-httpd_bad-sig-losses-get.h \
taler-auditor-httpd_closure-lags-get.c taler-auditor-httpd_closure-lags-get.h \
taler-auditor-httpd_progress-get.c taler-auditor-httpd_progress-get.h \
- taler-auditor-httpd_refreshes-hanging-get.c taler-auditor-httpd_refreshes-hanging-get.h \
taler-auditor-httpd_reserve-in-inconsistency-get.c taler-auditor-httpd_reserve-in-inconsistency-get.h \
taler-auditor-httpd_reserve-not-closed-inconsistency-get.c taler-auditor-httpd_reserve-not-closed-inconsistency-get.h \
taler-auditor-httpd_denominations-without-sigs-get.c taler-auditor-httpd_denominations-without-sigs-get.h \
diff --git a/src/auditor/report-lib.c b/src/auditor/report-lib.c
@@ -176,7 +176,8 @@ TALER_ARL_get_denomination_info_by_hash (
GNUNET_NO);
if (NULL == denominations_by_serial)
denominations_by_serial = GNUNET_CONTAINER_multiuuidmap_create (256,
- GNUNET_NO);
+ GNUNET_NO)
+ ;
qs = TALER_ARL_edb->iterate_denomination_info (TALER_ARL_edb->cls,
&add_denomination,
@@ -252,8 +253,8 @@ TALER_ARL_get_denomination_info_by_serial (
enum GNUNET_DB_QueryStatus qs;
struct GNUNET_Uuid uuid;
- serial_to_uuid (denom_serial, &uuid);
-
+ serial_to_uuid (denom_serial,
+ &uuid);
if (NULL == denominations_by_serial)
{
denominations_by_serial = GNUNET_CONTAINER_multiuuidmap_create (256,
diff --git a/src/auditor/taler-auditor-httpd.c b/src/auditor/taler-auditor-httpd.c
@@ -45,7 +45,6 @@
#include "taler-auditor-httpd_reserve-balance-insufficient-inconsistency-get.h"
#include "taler-auditor-httpd_bad-sig-losses-get.h"
#include "taler-auditor-httpd_closure-lags-get.h"
-#include "taler-auditor-httpd_refreshes-hanging-get.h"
#include "taler-auditor-httpd_mhd.h"
#include "taler-auditor-httpd.h"
#include "taler-auditor-httpd_delete_generic.h"
@@ -510,32 +509,6 @@ handle_mhd_request (void *cls,
.response_code = MHD_HTTP_OK,
.requires_auth = true,
.table = TALER_AUDITORDB_EMERGENCY },
- { .url = "/monitoring/refreshes-hanging",
- .method = MHD_HTTP_METHOD_GET,
- .mime_type = "application/json",
- .data = NULL,
- .data_size = 0,
- .handler = &TAH_REFRESHES_HANGING_handler_get,
- .response_code = MHD_HTTP_OK,
- .requires_auth = true },
- { .url = "/monitoring/refreshes-hanging",
- .method = MHD_HTTP_METHOD_DELETE,
- .mime_type = "application/json",
- .data = NULL,
- .data_size = 0,
- .handler = &TAH_delete_handler_generic,
- .response_code = MHD_HTTP_OK,
- .requires_auth = true,
- .table = TALER_AUDITORDB_REFRESHES_HANGING },
- { .url = "/monitoring/refreshes-hanging",
- .method = MHD_HTTP_METHOD_PATCH,
- .mime_type = "application/json",
- .data = NULL,
- .data_size = 0,
- .handler = &TAH_patch_handler_generic_suppressed,
- .response_code = MHD_HTTP_OK,
- .requires_auth = true,
- .table = TALER_AUDITORDB_REFRESHES_HANGING },
{ .url = "/monitoring/denomination-key-validity-withdraw-inconsistency",
.method = MHD_HTTP_METHOD_GET,
.mime_type = "application/json",
diff --git a/src/auditor/taler-auditor-httpd_refreshes-hanging-get.c b/src/auditor/taler-auditor-httpd_refreshes-hanging-get.c
@@ -1,134 +0,0 @@
-/*
- This file is part of TALER
- Copyright (C) 2024 Taler Systems SA
-
- TALER is free software; you can redistribute it and/or modify it under the
- terms of the GNU General Public License as published by the Free Software
- Foundation; either version 3, or (at your option) any later version.
-
- TALER is distributed in the hope that it will be useful, but WITHOUT ANY
- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
- A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along with
- TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
- */
-#include "platform.h"
-#include <gnunet/gnunet_util_lib.h>
-#include <gnunet/gnunet_json_lib.h>
-#include <jansson.h>
-#include <microhttpd.h>
-#include <pthread.h>
-#include "taler_json_lib.h"
-#include "taler_mhd_lib.h"
-#include "taler-auditor-httpd.h"
-#include "taler-auditor-httpd_refreshes-hanging-get.h"
-
-
-/**
- * Add refreshes-hanging to the list.
- *
- * @param[in,out] cls a `json_t *` array to extend
- * @param dc struct of inconsistencies
- * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop iterating
- */
-static enum GNUNET_GenericReturnValue
-process_refreshes_hanging (
- void *cls,
- const struct TALER_AUDITORDB_RefreshesHanging *dc)
-{
- json_t *list = cls;
- json_t *obj;
-
- obj = GNUNET_JSON_PACK (
- TALER_JSON_pack_amount ("amount",
- &dc->amount),
- GNUNET_JSON_pack_uint64 ("serial_id",
- dc->row_id),
- GNUNET_JSON_pack_uint64 ("problem_row",
- dc->problem_row_id)
- );
- GNUNET_break (0 ==
- json_array_append_new (list,
- obj));
- return GNUNET_OK;
-}
-
-
-MHD_RESULT
-TAH_REFRESHES_HANGING_handler_get (
- struct TAH_RequestHandler *rh,
- struct MHD_Connection *connection,
- void **connection_cls,
- const char *upload_data,
- size_t *upload_data_size,
- const char *const args[])
-{
- json_t *ja;
- enum GNUNET_DB_QueryStatus qs;
- int64_t limit = -20;
- uint64_t offset;
- bool return_suppressed = false;
-
- (void) rh;
- (void) connection_cls;
- (void) upload_data;
- (void) upload_data_size;
- if (GNUNET_SYSERR ==
- TAH_plugin->preflight (TAH_plugin->cls))
- {
- GNUNET_break (0);
- return TALER_MHD_reply_with_error (connection,
- MHD_HTTP_INTERNAL_SERVER_ERROR,
- TALER_EC_GENERIC_DB_SETUP_FAILED,
- NULL);
- }
- TALER_MHD_parse_request_snumber (connection,
- "limit",
- &limit);
- if (limit < 0)
- offset = INT64_MAX;
- else
- offset = 0;
- TALER_MHD_parse_request_number (connection,
- "offset",
- &offset);
- {
- const char *ret_s
- = MHD_lookup_connection_value (connection,
- MHD_GET_ARGUMENT_KIND,
- "return_suppressed");
-
- if ( (NULL != ret_s) &&
- (0 == strcmp (ret_s,
- "true")) )
- {
- return_suppressed = true;
- }
- }
- ja = json_array ();
- GNUNET_break (NULL != ja);
- qs = TAH_plugin->get_refreshes_hanging (
- TAH_plugin->cls,
- limit,
- offset,
- return_suppressed,
- &process_refreshes_hanging,
- ja);
- if (0 > qs)
- {
- GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs);
- json_decref (ja);
- TALER_LOG_WARNING (
- "Failed to handle GET /refreshes-hanging\n");
- return TALER_MHD_reply_with_error (connection,
- MHD_HTTP_INTERNAL_SERVER_ERROR,
- TALER_EC_GENERIC_DB_FETCH_FAILED,
- "refreshes-hanging");
- }
- return TALER_MHD_REPLY_JSON_PACK (
- connection,
- MHD_HTTP_OK,
- GNUNET_JSON_pack_array_steal ("refreshes_hanging",
- ja));
-}
diff --git a/src/auditor/taler-auditor-httpd_refreshes-hanging-get.h b/src/auditor/taler-auditor-httpd_refreshes-hanging-get.h
@@ -1,58 +0,0 @@
-/*
- This file is part of TALER
- Copyright (C) 2024 Taler Systems SA
-
- TALER is free software; you can redistribute it and/or modify it under the
- terms of the GNU General Public License as published by the Free Software
- Foundation; either version 3, or (at your option) any later version.
-
- TALER is distributed in the hope that it will be useful, but WITHOUT ANY
- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
- A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along with
- TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
- */
-
-
-#ifndef SRC_TALER_AUDITOR_HTTPD_REFRESHES_HANGING_GET_H
-#define SRC_TALER_AUDITOR_HTTPD_REFRESHES_HANGING_GET_H
-
-#include <gnunet/gnunet_util_lib.h>
-#include <microhttpd.h>
-#include "taler-auditor-httpd.h"
-
-/**
-* Initialize subsystem.
-*/
-void
-TEAH_REFRESHES_HANGING_GET_init (void);
-
-/**
-* Shut down subsystem.
-*/
-void
-TEAH_REFRESHES_HANGING_GET_done (void);
-
-/**
- * Handle a "/refreshes-hanging" request.
- *
- * @param rh context of the handler
- * @param connection the MHD connection to handle
- * @param[in,out] connection_cls the connection's closure (can be updated)
- * @param upload_data upload data
- * @param[in,out] upload_data_size number of bytes (left) in @a upload_data
- * @param args NULL-terminated array of remaining parts of the URI broken up at '/'
- * @return MHD result code
- */
-MHD_RESULT
-TAH_REFRESHES_HANGING_handler_get (
- struct TAH_RequestHandler *rh,
- struct MHD_Connection *connection,
- void **connection_cls,
- const char *upload_data,
- size_t *upload_data_size,
- const char *const args[]);
-
-
-#endif
diff --git a/src/auditor/taler-helper-auditor-coins.c b/src/auditor/taler-helper-auditor-coins.c
@@ -1,6 +1,6 @@
/*
This file is part of TALER
- Copyright (C) 2016-2024 Taler Systems SA
+ Copyright (C) 2016-2025 Taler Systems SA
TALER is free software; you can redistribute it and/or modify it under the
terms of the GNU Affero Public License as published by the Free Software
@@ -103,10 +103,6 @@ static TALER_ARL_DEF_AB (coins_emergencies_loss);
*/
static TALER_ARL_DEF_AB (coins_emergencies_loss_by_count);
-/**
- * Total amount lost by operations for which signatures were invalid.
- */
-static TALER_ARL_DEF_AB (total_refresh_hanging);
/**
* Coin and associated transaction history.
@@ -1084,93 +1080,6 @@ withdraw_cb (
/**
- * Closure for #reveal_data_cb().
- */
-struct RevealContext
-{
-
- /**
- * Denomination public data of the new coins.
- */
- const struct TALER_EXCHANGEDB_DenominationKeyInformation **new_issues;
-
- /**
- * Set to the size of the @a new_issues array.
- */
- unsigned int num_freshcoins;
-
- /**
- * Which coin row are we currently processing (for report generation).
- */
- uint64_t rowid;
-
- /**
- * Error status. #GNUNET_OK if all is OK.
- * #GNUNET_NO if a denomination key was not found
- * #GNUNET_SYSERR if we had a database error.
- */
- enum GNUNET_GenericReturnValue err;
-
- /**
- * Database error, if @e err is #GNUNET_SYSERR.
- */
- enum GNUNET_DB_QueryStatus qs;
-};
-
-
-/**
- * Function called with information about a refresh order.
- *
- * @param cls closure with a `struct RevealContext *` in it
- * @param num_freshcoins size of the @a rrcs array
- * @param rrcs array of @a num_freshcoins information about coins to be created
- */
-static void
-reveal_data_cb (void *cls,
- uint32_t num_freshcoins,
- const struct TALER_EXCHANGEDB_RefreshRevealedCoin *rrcs)
-{
- struct RevealContext *rctx = cls;
-
- rctx->num_freshcoins = num_freshcoins;
- rctx->new_issues = GNUNET_new_array (
- num_freshcoins,
- const struct TALER_EXCHANGEDB_DenominationKeyInformation *);
-
- /* Update outstanding amounts for all new coin's denominations */
- for (unsigned int i = 0; i < num_freshcoins; i++)
- {
- enum GNUNET_DB_QueryStatus qs;
-
- /* lookup new coin denomination key */
- qs = TALER_ARL_get_denomination_info_by_hash (&rrcs[i].h_denom_pub,
- &rctx->new_issues[i]);
- if (0 > qs)
- {
- GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qs);
- rctx->qs = qs;
- rctx->err = GNUNET_SYSERR;
- return;
- }
- if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == qs)
- {
- qs = report_row_inconsistency ("refresh_reveal",
- rctx->rowid,
- "denomination key not found");
- if (0 > qs)
- {
- GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qs);
- rctx->qs = qs;
- rctx->err = GNUNET_SYSERR;
- return;
- }
- rctx->err = GNUNET_NO;
- }
- }
-}
-
-
-/**
* Check that the @a coin_pub is a known coin with a proper
* signature for denominatinon @a denom_pub. If not, report
* a loss of @a loss_potential.
@@ -1326,38 +1235,40 @@ reduce_denom_balance (struct DenominationSummary *dso,
*
* @param cls closure
* @param rowid unique serial ID for the refresh session in our DB
- * @param denom_pub denomination public key of @a coin_pub
- * @param h_age_commitment hash of the age commitment for the coin
+ * @param old_denom_pub denomination public key of @a coin_pub
* @param coin_pub public key of the coin
* @param coin_sig signature from the coin
+ * @param h_age_commitment hash of the age commitment for the coin
* @param amount_with_fee amount that was deposited including fee
- * @param noreveal_index which index was picked by the exchange in cut-and-choose
- * @param rc what is the refresh commitment
+ * @param num_nds length of the @a new_denom_serials array
+ * @param new_denom_serials array of denomination serials of fresh coins
+ * @param rc what the refresh commitment
* @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop
*/
static enum GNUNET_GenericReturnValue
refresh_session_cb (void *cls,
uint64_t rowid,
- const struct TALER_DenominationPublicKey *denom_pub,
- const struct TALER_AgeCommitmentHash *h_age_commitment,
+ const struct TALER_DenominationPublicKey *old_denom_pub,
const struct TALER_CoinSpendPublicKeyP *coin_pub,
const struct TALER_CoinSpendSignatureP *coin_sig,
+ const struct TALER_AgeCommitmentHash *h_age_commitment,
const struct TALER_Amount *amount_with_fee,
- uint32_t noreveal_index,
+ size_t num_nds,
+ uint64_t new_denom_serials[static num_nds],
const struct TALER_RefreshCommitmentP *rc)
{
struct CoinContext *cc = cls;
const struct TALER_EXCHANGEDB_DenominationKeyInformation *issue;
struct DenominationSummary *dso;
enum GNUNET_DB_QueryStatus qs;
+ struct TALER_DenominationHashP h_denom_pub;
- (void) noreveal_index;
GNUNET_assert (rowid >=
TALER_ARL_USE_PP (coins_melt_serial_id)); /* should be monotonically increasing */
TALER_ARL_USE_PP (coins_melt_serial_id) = rowid + 1;
- qs = TALER_ARL_get_denomination_info (denom_pub,
+ qs = TALER_ARL_get_denomination_info (old_denom_pub,
&issue,
- NULL);
+ &h_denom_pub);
if (0 > qs)
{
GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qs);
@@ -1381,7 +1292,7 @@ refresh_session_cb (void *cls,
issue,
rowid,
coin_pub,
- denom_pub,
+ old_denom_pub,
amount_with_fee);
if (0 > qs)
{
@@ -1391,41 +1302,35 @@ refresh_session_cb (void *cls,
}
/* verify melt signature */
+ if (GNUNET_OK !=
+ TALER_wallet_melt_verify (amount_with_fee,
+ &issue->fees.refresh,
+ rc,
+ &h_denom_pub,
+ h_age_commitment,
+ coin_pub,
+ coin_sig))
{
- struct TALER_DenominationHashP h_denom_pub;
+ struct TALER_AUDITORDB_BadSigLosses bsl = {
+ .problem_row_id = rowid,
+ .operation = (char *) "melt",
+ .loss = *amount_with_fee,
+ .operation_specific_pub = coin_pub->eddsa_pub
+ };
- TALER_denom_pub_hash (denom_pub,
- &h_denom_pub);
- if (GNUNET_OK !=
- TALER_wallet_melt_verify (amount_with_fee,
- &issue->fees.refresh,
- rc,
- &h_denom_pub,
- h_age_commitment,
- coin_pub,
- coin_sig))
+ GNUNET_break_op (0);
+ qs = TALER_ARL_adb->insert_bad_sig_losses (
+ TALER_ARL_adb->cls,
+ &bsl);
+ if (qs < 0)
{
- struct TALER_AUDITORDB_BadSigLosses bsl = {
- .problem_row_id = rowid,
- .operation = (char *) "melt",
- .loss = *amount_with_fee,
- .operation_specific_pub = coin_pub->eddsa_pub
- };
-
- GNUNET_break_op (0);
- qs = TALER_ARL_adb->insert_bad_sig_losses (
- TALER_ARL_adb->cls,
- &bsl);
- if (qs < 0)
- {
- GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qs);
- cc->qs = qs;
- return GNUNET_SYSERR;
- }
- TALER_ARL_amount_add (&TALER_ARL_USE_AB (coin_irregular_loss),
- &TALER_ARL_USE_AB (coin_irregular_loss),
- amount_with_fee);
+ GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qs);
+ cc->qs = qs;
+ return GNUNET_SYSERR;
}
+ TALER_ARL_amount_add (&TALER_ARL_USE_AB (coin_irregular_loss),
+ &TALER_ARL_USE_AB (coin_irregular_loss),
+ amount_with_fee);
}
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Melting coin %s in denomination `%s' of value %s\n",
@@ -1433,80 +1338,33 @@ refresh_session_cb (void *cls,
GNUNET_h2s (&issue->denom_hash.hash),
TALER_amount2s (amount_with_fee));
-#pragma message "auditor's reveal requires refactoring for new refresh protocol"
-#if FIXME_NEW_REFRESH
{
struct TALER_Amount refresh_cost;
- struct RevealContext reveal_ctx = {
- .rowid = rowid,
- .err = GNUNET_OK
- };
-
- qs = TALER_ARL_edb->get_refresh_reveal (TALER_ARL_edb->cls,
- rc,
- &reveal_data_cb,
- &reveal_ctx);
- if (0 > qs)
- {
- GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qs);
- cc->qs = GNUNET_DB_STATUS_HARD_ERROR;
- return GNUNET_SYSERR;
- }
- if (GNUNET_SYSERR == reveal_ctx.err)
- {
- cc->qs = reveal_ctx.qs;
- GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == cc->qs);
- return GNUNET_SYSERR;
- }
- if ( (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == qs) ||
- (0 == reveal_ctx.num_freshcoins) )
- {
- /* This can legitimately happen if reveal was not yet called or only
- with invalid data, even if the exchange is correctly operating. We
- still report it. */
- struct TALER_AUDITORDB_RefreshesHanging rh = {
- .problem_row_id = rowid,
- .amount = *amount_with_fee
- };
-
- qs = TALER_ARL_adb->insert_refreshes_hanging (
- TALER_ARL_adb->cls,
- &rh);
- if (qs < 0)
- {
- GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qs);
- cc->qs = qs;
- return GNUNET_SYSERR;
- }
- TALER_ARL_amount_add (&TALER_ARL_USE_AB (total_refresh_hanging),
- &TALER_ARL_USE_AB (total_refresh_hanging),
- amount_with_fee);
- return GNUNET_OK;
- }
-
- if (GNUNET_NO == reveal_ctx.err)
- {
- GNUNET_free (reveal_ctx.new_issues);
- return GNUNET_OK;
- }
+ struct TALER_Amount amount_without_fee;
+ const struct TALER_EXCHANGEDB_DenominationKeyInformation *nis[num_nds];
/* Check that the resulting amounts are consistent with the value being
refreshed by calculating the total refresh cost */
GNUNET_assert (GNUNET_OK ==
TALER_amount_set_zero (amount_with_fee->currency,
&refresh_cost));
- for (unsigned int i = 0; i < reveal_ctx.num_freshcoins; i++)
+ for (size_t i = 0; i < num_nds; i++)
{
- const struct TALER_EXCHANGEDB_DenominationKeyInformation *ni
- = reveal_ctx.new_issues[i];
+ qs = TALER_ARL_get_denomination_info_by_serial (new_denom_serials[i],
+ &nis[i]);
+ if (0 > qs)
+ {
+ GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qs);
+ cc->qs = qs;
+ return GNUNET_SYSERR;
+ }
/* update cost of refresh */
-
TALER_ARL_amount_add (&refresh_cost,
&refresh_cost,
- &ni->fees.withdraw);
+ &nis[i]->fees.withdraw);
TALER_ARL_amount_add (&refresh_cost,
&refresh_cost,
- &ni->value);
+ &nis[i]->value);
}
/* compute contribution of old coin */
@@ -1555,10 +1413,10 @@ refresh_session_cb (void *cls,
}
/* update outstanding denomination amounts for fresh coins withdrawn */
- for (unsigned int i = 0; i < reveal_ctx.num_freshcoins; i++)
+ for (size_t i = 0; i < num_nds; i++)
{
const struct TALER_EXCHANGEDB_DenominationKeyInformation *ni
- = reveal_ctx.new_issues[i];
+ = nis[i];
struct DenominationSummary *dsi;
dsi = get_denomination_summary (cc,
@@ -1600,9 +1458,7 @@ refresh_session_cb (void *cls,
&ni->value);
}
}
- GNUNET_free (reveal_ctx.new_issues);
}
-#endif
/* update old coin's denomination balance */
dso = get_denomination_summary (cc,
@@ -2781,7 +2637,6 @@ analyze_coins (void *cls)
TALER_ARL_GET_AB (coins_reported_emergency_risk_by_amount),
TALER_ARL_GET_AB (coins_emergencies_loss),
TALER_ARL_GET_AB (coins_emergencies_loss_by_count),
- TALER_ARL_GET_AB (total_refresh_hanging),
NULL);
if (0 > qs)
{
@@ -2945,7 +2800,6 @@ analyze_coins (void *cls)
TALER_ARL_SET_AB (coins_reported_emergency_risk_by_amount),
TALER_ARL_SET_AB (coins_emergencies_loss),
TALER_ARL_SET_AB (coins_emergencies_loss_by_count),
- TALER_ARL_SET_AB (total_refresh_hanging),
NULL);
if (0 > qs)
{
@@ -2971,7 +2825,6 @@ analyze_coins (void *cls)
TALER_ARL_SET_AB (coins_reported_emergency_risk_by_amount),
TALER_ARL_SET_AB (coins_emergencies_loss),
TALER_ARL_SET_AB (coins_emergencies_loss_by_count),
- TALER_ARL_SET_AB (total_refresh_hanging),
NULL);
if (0 > qs)
{
diff --git a/src/auditordb/Makefile.am b/src/auditordb/Makefile.am
@@ -87,7 +87,6 @@ libtaler_plugin_auditordb_postgres_la_SOURCES = \
pg_get_purse_info.c pg_get_purse_info.h \
pg_get_purse_not_closed_inconsistencies.c pg_get_purse_not_closed_inconsistencies.h \
pg_get_purses.c pg_get_purses.h \
- pg_get_refreshes_hanging.c pg_get_refreshes_hanging.h \
pg_get_reserve_balance_insufficient_inconsistency.c pg_get_reserve_balance_insufficient_inconsistency.h \
pg_get_reserve_balance_summary_wrong_inconsistency.c pg_get_reserve_balance_summary_wrong_inconsistency.h \
pg_get_reserve_in_inconsistency.c pg_get_reserve_in_inconsistency.h \
@@ -122,7 +121,6 @@ libtaler_plugin_auditordb_postgres_la_SOURCES = \
pg_insert_pending_deposit.c pg_insert_pending_deposit.h \
pg_insert_purse_info.c pg_insert_purse_info.h \
pg_insert_purse_not_closed_inconsistencies.c pg_insert_purse_not_closed_inconsistencies.h \
- pg_insert_refreshes_hanging.c pg_insert_refreshes_hanging.h \
pg_insert_reserve_balance_insufficient_inconsistency.c pg_insert_reserve_balance_insufficient_inconsistency.h \
pg_insert_reserve_balance_summary_wrong_inconsistency.c pg_insert_reserve_balance_summary_wrong_inconsistency.h \
pg_insert_reserve_in_inconsistency.c pg_insert_reserve_in_inconsistency.h \
diff --git a/src/auditordb/pg_get_refreshes_hanging.c b/src/auditordb/pg_get_refreshes_hanging.c
@@ -1,162 +0,0 @@
-/*
- This file is part of TALER
- Copyright (C) 2024 Taler Systems SA
-
- TALER is free software; you can redistribute it and/or modify it under the
- terms of the GNU General Public License as published by the Free Software
- Foundation; either version 3, or (at your option) any later version.
-
- TALER is distributed in the hope that it will be useful, but WITHOUT ANY
- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
- A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along with
- TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
- */
-#include "platform.h"
-#include "taler_error_codes.h"
-#include "taler_dbevents.h"
-#include "taler_pq_lib.h"
-#include "pg_helper.h"
-#include "pg_get_refreshes_hanging.h"
-
-
-/**
- * Closure for #refreshes_hanging_cb().
- */
-struct RefreshesHangingContext
-{
-
- /**
- * Function to call for each RefreshesHanging.
- */
- TALER_AUDITORDB_RefreshesHangingCallback cb;
-
- /**
- * Closure for @e cb
- */
- void *cb_cls;
-
- /**
- * Plugin context.
- */
- struct PostgresClosure *pg;
-
- /**
- * Query status to return.
- */
- enum GNUNET_DB_QueryStatus qs;
-};
-
-
-/**
- * Helper function for #TAH_PG_get_refreshes_hanging().
- * To be called with the results of a SELECT statement
- * that has returned @a num_results results.
- *
- * @param cls closure of type `struct RefreshesHanging *`
- * @param result the postgres result
- * @param num_results the number of results in @a result
- */
-static void
-refreshes_hanging_cb (void *cls,
- PGresult *result,
- unsigned int num_results)
-{
- struct RefreshesHangingContext *dcc = cls;
- struct PostgresClosure *pg = dcc->pg;
-
- for (unsigned int i = 0; i < num_results; i++)
- {
- struct TALER_AUDITORDB_RefreshesHanging dc;
- struct GNUNET_PQ_ResultSpec rs[] = {
- GNUNET_PQ_result_spec_uint64 ("row_id",
- &dc.row_id),
- GNUNET_PQ_result_spec_uint64 ("problem_row_id",
- &dc.problem_row_id),
- TALER_PQ_RESULT_SPEC_AMOUNT ("amount",
- &dc.amount),
- GNUNET_PQ_result_spec_end
- };
- enum GNUNET_GenericReturnValue rval;
-
- if (GNUNET_OK !=
- GNUNET_PQ_extract_result (result,
- rs,
- i))
- {
- GNUNET_break (0);
- dcc->qs = GNUNET_DB_STATUS_HARD_ERROR;
- return;
- }
- dcc->qs = i + 1;
- rval = dcc->cb (dcc->cb_cls,
- &dc);
- GNUNET_PQ_cleanup_result (rs);
- if (GNUNET_OK != rval)
- break;
- }
-}
-
-
-enum GNUNET_DB_QueryStatus
-TAH_PG_get_refreshes_hanging (
- void *cls,
- int64_t limit,
- uint64_t offset,
- bool return_suppressed,
- TALER_AUDITORDB_RefreshesHangingCallback cb,
- void *cb_cls)
-{
- struct PostgresClosure *pg = cls;
- uint64_t plimit = (uint64_t) ((limit < 0) ? -limit : limit);
- struct GNUNET_PQ_QueryParam params[] = {
- GNUNET_PQ_query_param_uint64 (&offset),
- GNUNET_PQ_query_param_bool (return_suppressed),
- GNUNET_PQ_query_param_uint64 (&plimit),
- GNUNET_PQ_query_param_end
- };
- struct RefreshesHangingContext dcc = {
- .cb = cb,
- .cb_cls = cb_cls,
- .pg = pg
- };
- enum GNUNET_DB_QueryStatus qs;
-
- PREPARE (pg,
- "auditor_refreshes_hanging_get_desc",
- "SELECT"
- " row_id"
- ",problem_row_id"
- ",amount"
- " FROM auditor_refreshes_hanging"
- " WHERE (row_id < $1)"
- " AND ($2 OR suppressed is false)"
- " ORDER BY row_id DESC"
- " LIMIT $3"
- );
- PREPARE (pg,
- "auditor_refreshes_hanging_get_asc",
- "SELECT"
- " row_id"
- ",problem_row_id"
- ",amount"
- " FROM auditor_refreshes_hanging"
- " WHERE (row_id > $1)"
- " AND ($2 OR suppressed is false)"
- " ORDER BY row_id ASC"
- " LIMIT $3"
- );
- qs = GNUNET_PQ_eval_prepared_multi_select (
- pg->conn,
- (limit > 0)
- ? "auditor_refreshes_hanging_get_asc"
- : "auditor_refreshes_hanging_get_desc",
- params,
- &refreshes_hanging_cb,
- &dcc);
- if (qs > 0)
- return dcc.qs;
- GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR != qs);
- return qs;
-}
diff --git a/src/auditordb/pg_get_refreshes_hanging.h b/src/auditordb/pg_get_refreshes_hanging.h
@@ -1,43 +0,0 @@
-/*
- This file is part of TALER
- Copyright (C) 2024 Taler Systems SA
-
- TALER is free software; you can redistribute it and/or modify it under the
- terms of the GNU General Public License as published by the Free Software
- Foundation; either version 3, or (at your option) any later version.
-
- TALER is distributed in the hope that it will be useful, but WITHOUT ANY
- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
- A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along with
- TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
- */
-
-#ifndef SRC_PG_GET_REFRESHES_HANGING_H
-#define SRC_PG_GET_REFRESHES_HANGING_H
-
-#include "taler_util.h"
-#include "taler_auditordb_plugin.h"
-
-/**
- * Get information about hanging refreshes from the database.
- *
- * @param cls the @e cls of this struct with the plugin-specific state
- * @param limit number of records to return, negative for descending
- * @param offset table row to start from, exclusive, direction determined by @a limit
- * @param return_suppressed should suppressed rows be returned anyway?
- * @param cb function to call with results
- * @param cb_cls closure for @a cb
- * @return query result status
- */
-enum GNUNET_DB_QueryStatus
-TAH_PG_get_refreshes_hanging (
- void *cls,
- int64_t limit,
- uint64_t offset,
- bool return_suppressed,
- TALER_AUDITORDB_RefreshesHangingCallback cb,
- void *cb_cls);
-
-#endif
diff --git a/src/auditordb/pg_insert_refreshes_hanging.c b/src/auditordb/pg_insert_refreshes_hanging.c
@@ -1,45 +0,0 @@
-/*
- This file is part of TALER
- Copyright (C) 2024 Taler Systems SA
-
- TALER is free software; you can redistribute it and/or modify it under the
- terms of the GNU General Public License as published by the Free Software
- Foundation; either version 3, or (at your option) any later version.
-
- TALER is distributed in the hope that it will be useful, but WITHOUT ANY
- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
- A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along with
- TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
- */
-#include "platform.h"
-#include "taler_pq_lib.h"
-#include "pg_helper.h"
-#include "pg_insert_refreshes_hanging.h"
-
-
-enum GNUNET_DB_QueryStatus
-TAH_PG_insert_refreshes_hanging (
- void *cls,
- const struct TALER_AUDITORDB_RefreshesHanging *dc)
-{
- struct PostgresClosure *pg = cls;
- struct GNUNET_PQ_QueryParam params[] = {
- TALER_PQ_query_param_amount (pg->conn,
- &dc->amount),
- GNUNET_PQ_query_param_uint64 (&dc->problem_row_id),
- GNUNET_PQ_query_param_end
- };
-
- PREPARE (pg,
- "auditor_refreshes_hanging_insert",
- "INSERT INTO auditor_refreshes_hanging "
- "(amount"
- ",problem_row_id"
- ") VALUES ($1,$2);"
- );
- return GNUNET_PQ_eval_prepared_non_select (pg->conn,
- "auditor_refreshes_hanging_insert",
- params);
-}
diff --git a/src/auditordb/pg_insert_refreshes_hanging.h b/src/auditordb/pg_insert_refreshes_hanging.h
@@ -1,36 +0,0 @@
-/*
- This file is part of TALER
- Copyright (C) 2024 Taler Systems SA
-
- TALER is free software; you can redistribute it and/or modify it under the
- terms of the GNU General Public License as published by the Free Software
- Foundation; either version 3, or (at your option) any later version.
-
- TALER is distributed in the hope that it will be useful, but WITHOUT ANY
- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
- A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along with
- TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
- */
-
-#ifndef SRC_PG_INSERT_REFRESHES_HANGING_H
-#define SRC_PG_INSERT_REFRESHES_HANGING_H
-
-#include "taler_util.h"
-#include "taler_auditordb_plugin.h"
-
-
-/**
- * Insert information about a refreshes hanging into the database.
- *
- * @param cls the @e cls of this struct with the plugin-specific state
- * @param dc deposit confirmation information to store
- * @return query result status
- */
-enum GNUNET_DB_QueryStatus
-TAH_PG_insert_refreshes_hanging (
- void *cls,
- const struct TALER_AUDITORDB_RefreshesHanging *dc);
-
-#endif // SRC_PG_INSERT_REFRESHES_HANGING_H
diff --git a/src/auditordb/plugin_auditordb_postgres.c b/src/auditordb/plugin_auditordb_postgres.c
@@ -93,9 +93,6 @@
#include "pg_get_purse_not_closed_inconsistencies.h"
#include "pg_insert_purse_not_closed_inconsistencies.h"
-#include "pg_get_refreshes_hanging.h"
-#include "pg_insert_refreshes_hanging.h"
-
#include "pg_get_reserve_balance_insufficient_inconsistency.h"
#include "pg_insert_reserve_balance_insufficient_inconsistency.h"
@@ -658,10 +655,6 @@ libtaler_plugin_auditordb_postgres_init (void *cls)
plugin->insert_auditor_closure_lags = &TAH_PG_insert_auditor_closure_lags;
plugin->get_auditor_closure_lags = &TAH_PG_get_auditor_closure_lags;
-
- plugin->insert_refreshes_hanging = &TAH_PG_insert_refreshes_hanging;
- plugin->get_refreshes_hanging = &TAH_PG_get_refreshes_hanging;
-
plugin->insert_reserve_in_inconsistency =
&TAH_PG_insert_reserve_in_inconsistency;
plugin->get_reserve_in_inconsistency
diff --git a/src/exchange/taler-exchange-httpd_reveal-melt.c b/src/exchange/taler-exchange-httpd_reveal-melt.c
@@ -33,6 +33,8 @@
#include "taler-exchange-httpd_keys.h"
#define KAPPA_MINUS_1 (TALER_CNC_KAPPA - 1)
+
+
/**
* State for an /reveal-melt operation.
*/
@@ -137,7 +139,7 @@ find_original_refresh (
* @param connection The MHD connection to handle
* @param actx The context of the operation, only partially built at this time
* @param[out] mhd_ret The result if a reply is queued for MHD
- * @return GNUNET_OK on success, otherwise a reply is queued for MHD
+ * @return #GNUNET_OK on success, otherwise a reply is queued for MHD and @a mhd_ret is set
*/
static enum GNUNET_GenericReturnValue
compare_age_commitment (
@@ -188,7 +190,7 @@ compare_age_commitment (
* @param old_age_commitment The age commitment of the old coin, might be NULL
* @param[out] detail planchet detail to write to write
* @param[out] result On error, a HTTP-response will be queued and result set accordingly
- * @return GNUNET_OK on success, GNUNET_SYSERR otherwise, with an error message
+ * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise, with an error message
* written to the client and @e result set.
*/
static enum GNUNET_GenericReturnValue
@@ -256,8 +258,8 @@ calculate_blinded_detail (
nonce,
&coin_priv,
no_age_commitment
- ? NULL
- : &ach,
+ ? NULL
+ : &ach,
&c_hash,
detail);
if (GNUNET_OK != ret)
@@ -296,7 +298,7 @@ calculate_blinded_detail (
* @param old_age_commitment The age commitment of the original coin
* @param signatures The secrets of the disclosed coins, KAPPA_MINUS_1*num_coins many
* @param[out] result On error, a HTTP-response will be queued and result set accordingly
- * @return GNUNET_OK on success, GNUNET_SYSERR otherwise
+ * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise
*/
static enum GNUNET_GenericReturnValue
verify_commitment (
diff --git a/src/exchangedb/pg_select_refreshes_above_serial_id.c b/src/exchangedb/pg_select_refreshes_above_serial_id.c
@@ -1,6 +1,6 @@
/*
This file is part of TALER
- Copyright (C) 2022 Taler Systems SA
+ Copyright (C) 2022, 2025 Taler Systems SA
TALER is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
@@ -72,34 +72,35 @@ refreshs_serial_helper_cb (void *cls,
for (unsigned int i = 0; i<num_results; i++)
{
- struct TALER_DenominationPublicKey denom_pub;
+ struct TALER_DenominationPublicKey old_denom_pub;
struct TALER_CoinSpendPublicKeyP coin_pub;
struct TALER_CoinSpendSignatureP coin_sig;
struct TALER_AgeCommitmentHash h_age_commitment;
bool ac_isnull;
struct TALER_Amount amount_with_fee;
- uint32_t noreveal_index;
uint64_t rowid;
struct TALER_RefreshCommitmentP rc;
+ size_t num_nds;
+ uint64_t *nds;
struct GNUNET_PQ_ResultSpec rs[] = {
- TALER_PQ_result_spec_denom_pub ("denom_pub",
- &denom_pub),
+ TALER_PQ_result_spec_denom_pub ("old_denom_pub",
+ &old_denom_pub),
+ GNUNET_PQ_result_spec_auto_from_type ("old_coin_pub",
+ &coin_pub),
GNUNET_PQ_result_spec_allow_null (
GNUNET_PQ_result_spec_auto_from_type ("age_commitment_hash",
&h_age_commitment),
&ac_isnull),
- GNUNET_PQ_result_spec_auto_from_type ("old_coin_pub",
- &coin_pub),
GNUNET_PQ_result_spec_auto_from_type ("old_coin_sig",
&coin_sig),
TALER_PQ_RESULT_SPEC_AMOUNT ("amount_with_fee",
&amount_with_fee),
- GNUNET_PQ_result_spec_uint32 ("noreveal_index",
- &noreveal_index),
- GNUNET_PQ_result_spec_uint64 ("melt_serial_id",
+ GNUNET_PQ_result_spec_uint64 ("refresh_id",
&rowid),
- GNUNET_PQ_result_spec_auto_from_type ("rc",
- &rc),
+ GNUNET_PQ_result_spec_array_uint64 (pg->conn,
+ "new_denominations_serials",
+ &num_nds,
+ &nds),
GNUNET_PQ_result_spec_end
};
enum GNUNET_GenericReturnValue ret;
@@ -116,12 +117,13 @@ refreshs_serial_helper_cb (void *cls,
ret = rsc->cb (rsc->cb_cls,
rowid,
- &denom_pub,
- ac_isnull ? NULL : &h_age_commitment,
+ &old_denom_pub,
&coin_pub,
&coin_sig,
+ ac_isnull ? NULL : &h_age_commitment,
&amount_with_fee,
- noreveal_index,
+ num_nds,
+ nds,
&rc);
GNUNET_PQ_cleanup_result (rs);
if (GNUNET_OK != ret)
@@ -151,28 +153,29 @@ TEH_PG_select_refreshes_above_serial_id (
enum GNUNET_DB_QueryStatus qs;
PREPARE (pg,
- "audit_get_refresh_commitments_incr",
+ "select_refreshes_above_serial_id",
"SELECT"
- " denom.denom_pub"
- ",kc.coin_pub AS old_coin_pub"
+ " denom.denom_pub AS old_denom_pub"
+ ",r.old_coin_pub"
",kc.age_commitment_hash"
- ",old_coin_sig"
- ",amount_with_fee"
- ",noreveal_index"
- ",melt_serial_id"
- ",rc"
- " FROM refresh_commitments"
- " JOIN known_coins kc"
- " ON (refresh_commitments.old_coin_pub = kc.coin_pub)"
- " JOIN denominations denom"
- " ON (kc.denominations_serial = denom.denominations_serial)"
- " WHERE melt_serial_id>=$1"
- " ORDER BY melt_serial_id ASC;");
- qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn,
- "audit_get_refresh_commitments_incr",
- params,
- &refreshs_serial_helper_cb,
- &rsc);
+ ",r.old_coin_sig"
+ ",r.amount_with_fee"
+ ",r.refresh_id"
+ ",r.rc"
+ ",r.denom_serials AS new_denominations_serials"
+ " FROM refresh r"
+ " JOIN known_coins kc"
+ " ON (r.old_coin_pub = kc.coin_pub)"
+ " JOIN denominations denom"
+ " ON (kc.denominations_serial = denom.denominations_serial)"
+ " WHERE refresh_id>=$1"
+ " ORDER BY refresh_id ASC;");
+ qs = GNUNET_PQ_eval_prepared_multi_select (
+ pg->conn,
+ "select_refreshes_above_serial_id",
+ params,
+ &refreshs_serial_helper_cb,
+ &rsc);
if (GNUNET_OK != rsc.status)
return GNUNET_DB_STATUS_HARD_ERROR;
return qs;
diff --git a/src/include/taler_auditordb_plugin.h b/src/include/taler_auditordb_plugin.h
@@ -323,15 +323,6 @@ struct TALER_AUDITORDB_Progress
uint64_t progress_offset;
};
-/**
- * Information about a refreshes hanging
- */
-struct TALER_AUDITORDB_RefreshesHanging
-{
- uint64_t row_id;
- uint64_t problem_row_id;
- struct TALER_Amount amount;
-};
/**
* Information about a fee time inconsistency
@@ -508,19 +499,6 @@ typedef enum GNUNET_GenericReturnValue
/**
- * Function called with refreshes hanging stored in
- * the auditor's database.
- *
- * @param cls closure
- * @param dc the structure itself
- * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop iterating
- */
-typedef enum GNUNET_GenericReturnValue
-(*TALER_AUDITORDB_RefreshesHangingCallback)(
- void *cls,
- const struct TALER_AUDITORDB_RefreshesHanging *dc);
-
-/**
* Function called with fee time inconsistency stored in
* the auditor's database.
*
@@ -968,7 +946,7 @@ struct TALER_AUDITORDB_Plugin
* #GNUNET_SYSERR if we have no DB connection
*/
enum GNUNET_GenericReturnValue
- (*preflight)(void *cls);
+ (*preflight)(void *cls);
/**
@@ -1025,8 +1003,8 @@ struct TALER_AUDITORDB_Plugin
* @return #GNUNET_OK upon success; #GNUNET_SYSERR upon failure
*/
enum GNUNET_GenericReturnValue
- (*drop_tables)(void *cls,
- bool drop_exchangelist);
+ (*drop_tables)(void *cls,
+ bool drop_exchangelist);
/**
@@ -1038,9 +1016,9 @@ struct TALER_AUDITORDB_Plugin
* @return #GNUNET_OK upon success; #GNUNET_SYSERR upon failure
*/
enum GNUNET_GenericReturnValue
- (*create_tables)(void *cls,
- bool support_partitions,
- uint32_t num_partitions);
+ (*create_tables)(void *cls,
+ bool support_partitions,
+ uint32_t num_partitions);
/**
@@ -1050,7 +1028,7 @@ struct TALER_AUDITORDB_Plugin
* @return #GNUNET_OK on success
*/
enum GNUNET_GenericReturnValue
- (*start)(void *cls);
+ (*start)(void *cls);
/**
@@ -1060,7 +1038,7 @@ struct TALER_AUDITORDB_Plugin
* @return transaction status code
*/
enum GNUNET_DB_QueryStatus
- (*commit)(void *cls);
+ (*commit)(void *cls);
/**
@@ -1081,7 +1059,7 @@ struct TALER_AUDITORDB_Plugin
* #GNUNET_SYSERR on DB errors
*/
enum GNUNET_GenericReturnValue
- (*gc)(void *cls);
+ (*gc)(void *cls);
/**
@@ -1095,7 +1073,7 @@ struct TALER_AUDITORDB_Plugin
* @return transaction status code
*/
enum GNUNET_DB_QueryStatus
- (*insert_auditor_progress)(
+ (*insert_auditor_progress)(
void *cls,
const char *progress_key,
uint64_t progress_offset,
@@ -1112,7 +1090,7 @@ struct TALER_AUDITORDB_Plugin
* @return transaction status code
*/
enum GNUNET_DB_QueryStatus
- (*update_auditor_progress)(
+ (*update_auditor_progress)(
void *cls,
const char *progress_key,
uint64_t progress_offset,
@@ -1128,10 +1106,10 @@ struct TALER_AUDITORDB_Plugin
* @return transaction status code
*/
enum GNUNET_DB_QueryStatus
- (*get_auditor_progress)(void *cls,
- const char *progress_key,
- uint64_t *progress_offset,
- ...);
+ (*get_auditor_progress)(void *cls,
+ const char *progress_key,
+ uint64_t *progress_offset,
+ ...);
/**
@@ -1145,10 +1123,10 @@ struct TALER_AUDITORDB_Plugin
* @return transaction status code
*/
enum GNUNET_DB_QueryStatus
- (*insert_balance)(void *cls,
- const char *balance_key,
- const struct TALER_Amount *balance_value,
- ...);
+ (*insert_balance)(void *cls,
+ const char *balance_key,
+ const struct TALER_Amount *balance_value,
+ ...);
/**
@@ -1162,10 +1140,10 @@ struct TALER_AUDITORDB_Plugin
* @return transaction status code
*/
enum GNUNET_DB_QueryStatus
- (*update_balance)(void *cls,
- const char *balance_key,
- const struct TALER_Amount *balance_amount,
- ...);
+ (*update_balance)(void *cls,
+ const char *balance_key,
+ const struct TALER_Amount *balance_amount,
+ ...);
/**
@@ -1178,10 +1156,10 @@ struct TALER_AUDITORDB_Plugin
* @return transaction status code
*/
enum GNUNET_DB_QueryStatus
- (*get_balance)(void *cls,
- const char *balance_key,
- struct TALER_Amount *balance_value,
- ...);
+ (*get_balance)(void *cls,
+ const char *balance_key,
+ struct TALER_Amount *balance_value,
+ ...);
/**
@@ -1194,7 +1172,7 @@ struct TALER_AUDITORDB_Plugin
* @return query result status
*/
enum GNUNET_DB_QueryStatus
- (*get_balances)(
+ (*get_balances)(
void *cls,
const char *balance_key,
TALER_AUDITORDB_BalancesCallback cb,
@@ -1210,7 +1188,7 @@ struct TALER_AUDITORDB_Plugin
* @return query result status
*/
enum GNUNET_DB_QueryStatus
- (*get_progress_points)(
+ (*get_progress_points)(
void *cls,
const char *progress_key,
TALER_AUDITORDB_ProgressPointsCallback cb,
@@ -1224,7 +1202,7 @@ struct TALER_AUDITORDB_Plugin
* @return query result status
*/
enum GNUNET_DB_QueryStatus
- (*insert_exchange_signkey)(
+ (*insert_exchange_signkey)(
void *cls,
const struct TALER_AUDITORDB_ExchangeSigningKey *sk);
@@ -1237,7 +1215,7 @@ struct TALER_AUDITORDB_Plugin
* @return query result status
*/
enum GNUNET_DB_QueryStatus
- (*insert_deposit_confirmation)(
+ (*insert_deposit_confirmation)(
void *cls,
const struct TALER_AUDITORDB_DepositConfirmation *dc);
@@ -1254,7 +1232,7 @@ struct TALER_AUDITORDB_Plugin
* @return query result status
*/
enum GNUNET_DB_QueryStatus
- (*get_deposit_confirmations)(
+ (*get_deposit_confirmations)(
void *cls,
int64_t limit,
uint64_t offset,
@@ -1275,7 +1253,7 @@ struct TALER_AUDITORDB_Plugin
* @return query result status
*/
enum GNUNET_DB_QueryStatus
- (*get_amount_arithmetic_inconsistency)(
+ (*get_amount_arithmetic_inconsistency)(
void *cls,
int64_t limit,
uint64_t offset,
@@ -1284,7 +1262,7 @@ struct TALER_AUDITORDB_Plugin
void *cb_cls);
enum GNUNET_DB_QueryStatus
- (*get_coin_inconsistency)(
+ (*get_coin_inconsistency)(
void *cls,
int64_t limit,
uint64_t offset,
@@ -1293,7 +1271,7 @@ struct TALER_AUDITORDB_Plugin
void *cb_cls);
enum GNUNET_DB_QueryStatus
- (*get_row_inconsistency)(
+ (*get_row_inconsistency)(
void *cls,
int64_t limit,
uint64_t offset,
@@ -1302,7 +1280,7 @@ struct TALER_AUDITORDB_Plugin
void *cb_cls);
enum GNUNET_DB_QueryStatus
- (*get_emergency)(
+ (*get_emergency)(
void *cls,
int64_t limit,
uint64_t offset,
@@ -1311,7 +1289,7 @@ struct TALER_AUDITORDB_Plugin
void *cb_cls);
enum GNUNET_DB_QueryStatus
- (*get_emergency_by_count)(
+ (*get_emergency_by_count)(
void *cls,
int64_t limit,
uint64_t offset,
@@ -1320,7 +1298,7 @@ struct TALER_AUDITORDB_Plugin
void *cb_cls);
enum GNUNET_DB_QueryStatus
- (*get_denomination_key_validity_withdraw_inconsistency)(
+ (*get_denomination_key_validity_withdraw_inconsistency)(
void *cls,
int64_t limit,
uint64_t offset,
@@ -1329,7 +1307,7 @@ struct TALER_AUDITORDB_Plugin
void *cb_cls);
enum GNUNET_DB_QueryStatus
- (*get_purse_not_closed_inconsistencies)(
+ (*get_purse_not_closed_inconsistencies)(
void *cls,
int64_t limit,
uint64_t offset,
@@ -1338,7 +1316,7 @@ struct TALER_AUDITORDB_Plugin
void *cb_cls);
enum GNUNET_DB_QueryStatus
- (*get_reserve_balance_insufficient_inconsistency)(
+ (*get_reserve_balance_insufficient_inconsistency)(
void *cls,
int64_t limit,
uint64_t offset,
@@ -1347,7 +1325,7 @@ struct TALER_AUDITORDB_Plugin
void *cb_cls);
enum GNUNET_DB_QueryStatus
- (*get_bad_sig_losses)(
+ (*get_bad_sig_losses)(
void *cls,
int64_t limit,
uint64_t offset,
@@ -1358,7 +1336,7 @@ struct TALER_AUDITORDB_Plugin
void *cb_cls);
enum GNUNET_DB_QueryStatus
- (*get_auditor_closure_lags)(
+ (*get_auditor_closure_lags)(
void *cls,
int64_t limit,
uint64_t offset,
@@ -1378,21 +1356,12 @@ struct TALER_AUDITORDB_Plugin
* found
*/
enum GNUNET_DB_QueryStatus
- (*delete_auditor_closure_lag)(
+ (*delete_auditor_closure_lag)(
void *cls,
const struct TALER_Amount *amount,
const struct TALER_WireTransferIdentifierRawP *wtid,
struct TALER_FullPayto credit_account_uri);
- enum GNUNET_DB_QueryStatus
- (*get_refreshes_hanging)(
- void *cls,
- int64_t limit,
- uint64_t offset,
- bool return_suppressed,
- TALER_AUDITORDB_RefreshesHangingCallback cb,
- void *cb_cls);
-
/**
* Delete information about a deposit confirmation from the database.
*
@@ -1401,138 +1370,127 @@ struct TALER_AUDITORDB_Plugin
* @return query result status
*/
enum GNUNET_DB_QueryStatus
- (*delete_amount_arithmetic_inconsistency)(
- void *cls,
- uint64_t row_id);
-
- enum GNUNET_DB_QueryStatus
- (*delete_coin_inconsistency)(
+ (*delete_amount_arithmetic_inconsistency)(
void *cls,
uint64_t row_id);
enum GNUNET_DB_QueryStatus
- (*delete_row_inconsistency)(
+ (*delete_coin_inconsistency)(
void *cls,
uint64_t row_id);
enum GNUNET_DB_QueryStatus
- (*delete_emergency)(
+ (*delete_row_inconsistency)(
void *cls,
uint64_t row_id);
enum GNUNET_DB_QueryStatus
- (*delete_emergency_by_count)(
+ (*delete_emergency)(
void *cls,
uint64_t row_id);
enum GNUNET_DB_QueryStatus
- (*delete_denomination_key_validity_withdraw_inconsistency)(
+ (*delete_emergency_by_count)(
void *cls,
uint64_t row_id);
enum GNUNET_DB_QueryStatus
- (*delete_purse_not_closed_inconsistencies)(
+ (*delete_denomination_key_validity_withdraw_inconsistency)(
void *cls,
uint64_t row_id);
enum GNUNET_DB_QueryStatus
- (*delete_reserve_balance_insufficient_inconsistency)(
+ (*delete_purse_not_closed_inconsistencies)(
void *cls,
uint64_t row_id);
enum GNUNET_DB_QueryStatus
- (*delete_bad_sig_losses)(
+ (*delete_reserve_balance_insufficient_inconsistency)(
void *cls,
uint64_t row_id);
enum GNUNET_DB_QueryStatus
- (*delete_auditor_closure_lags)(
+ (*delete_bad_sig_losses)(
void *cls,
uint64_t row_id);
enum GNUNET_DB_QueryStatus
- (*delete_progress)(
+ (*delete_auditor_closure_lags)(
void *cls,
uint64_t row_id);
enum GNUNET_DB_QueryStatus
- (*delete_refreshes_hanging)(
+ (*delete_progress)(
void *cls,
uint64_t row_id);
-
/**
-* Insert information about a deposit confirmation into the database.
-*
-* @param cls the @e cls of this struct with the plugin-specific state
-* @param dc deposit confirmation information to store
-* @return query result status
-*/
+ * Insert information about a deposit confirmation into the database.
+ *
+ * @param cls the @e cls of this struct with the plugin-specific state
+ * @param dc deposit confirmation information to store
+ * @return query result status
+ */
enum GNUNET_DB_QueryStatus
- (*insert_amount_arithmetic_inconsistency)(
+ (*insert_amount_arithmetic_inconsistency)(
void *cls,
const struct TALER_AUDITORDB_AmountArithmeticInconsistency *dc);
enum GNUNET_DB_QueryStatus
- (*insert_coin_inconsistency)(
+ (*insert_coin_inconsistency)(
void *cls,
const struct TALER_AUDITORDB_CoinInconsistency *dc);
enum GNUNET_DB_QueryStatus
- (*insert_row_inconsistency)(
+ (*insert_row_inconsistency)(
void *cls,
const struct TALER_AUDITORDB_RowInconsistency *dc);
enum GNUNET_DB_QueryStatus
- (*insert_emergency)(
+ (*insert_emergency)(
void *cls,
const struct TALER_AUDITORDB_Emergency *dc);
enum GNUNET_DB_QueryStatus
- (*insert_emergency_by_count)(
+ (*insert_emergency_by_count)(
void *cls,
const struct TALER_AUDITORDB_EmergenciesByCount *dc);
enum GNUNET_DB_QueryStatus
- (*insert_denomination_key_validity_withdraw_inconsistency)(
+ (*insert_denomination_key_validity_withdraw_inconsistency)(
void *cls,
const struct
TALER_AUDITORDB_DenominationKeyValidityWithdrawInconsistency *dc);
enum GNUNET_DB_QueryStatus
- (*insert_purse_not_closed_inconsistencies)(
+ (*insert_purse_not_closed_inconsistencies)(
void *cls,
const struct TALER_AUDITORDB_PurseNotClosedInconsistencies *dc);
enum GNUNET_DB_QueryStatus
- (*insert_reserve_balance_insufficient_inconsistency)(
+ (*insert_reserve_balance_insufficient_inconsistency)(
void *cls,
const struct TALER_AUDITORDB_ReserveBalanceInsufficientInconsistency *dc);
enum GNUNET_DB_QueryStatus
- (*insert_bad_sig_losses)(
+ (*insert_bad_sig_losses)(
void *cls,
const struct TALER_AUDITORDB_BadSigLosses *dc);
enum GNUNET_DB_QueryStatus
- (*insert_auditor_closure_lags)(
+ (*insert_auditor_closure_lags)(
void *cls,
const struct TALER_AUDITORDB_ClosureLags *dc);
enum GNUNET_DB_QueryStatus
- (*insert_refreshes_hanging)(
- void *cls,
- const struct TALER_AUDITORDB_RefreshesHanging *dc);
-
- enum GNUNET_DB_QueryStatus
- (*update_generic_suppressed)(
+ (*update_generic_suppressed)(
void *cls,
enum TALER_AUDITORDB_DeletableSuppressableTables table,
uint64_t row_id,
bool suppressed);
enum GNUNET_DB_QueryStatus
- (*delete_generic)(
+ (*delete_generic)(
void *cls,
enum TALER_AUDITORDB_DeletableSuppressableTables table,
uint64_t row_id);
@@ -1546,14 +1504,14 @@ struct TALER_AUDITORDB_Plugin
* @return query result status
*/
enum GNUNET_DB_QueryStatus
- (*lookup_reserve_in_inconsistency) (
+ (*lookup_reserve_in_inconsistency) (
void *cls,
uint64_t bank_row_id,
struct TALER_AUDITORDB_ReserveInInconsistency *dc);
enum GNUNET_DB_QueryStatus
- (*get_reserve_in_inconsistency)(
+ (*get_reserve_in_inconsistency)(
void *cls,
int64_t limit,
uint64_t offset,
@@ -1570,13 +1528,13 @@ struct TALER_AUDITORDB_Plugin
* @return query result status
*/
enum GNUNET_DB_QueryStatus
- (*delete_reserve_in_inconsistency)(
+ (*delete_reserve_in_inconsistency)(
void *cls,
uint64_t row_id);
enum GNUNET_DB_QueryStatus
- (*insert_reserve_in_inconsistency)(
+ (*insert_reserve_in_inconsistency)(
void *cls,
const struct TALER_AUDITORDB_ReserveInInconsistency *dc);
@@ -1590,13 +1548,13 @@ struct TALER_AUDITORDB_Plugin
* @param[out] dc details to return
*/
enum GNUNET_DB_QueryStatus
- (*select_reserve_in_inconsistency)(
+ (*select_reserve_in_inconsistency)(
void *cls,
uint64_t bank_row_id,
struct TALER_AUDITORDB_ReserveInInconsistency *dc);
enum GNUNET_DB_QueryStatus
- (*get_reserve_not_closed_inconsistency)(
+ (*get_reserve_not_closed_inconsistency)(
void *cls,
int64_t limit,
uint64_t offset,
@@ -1606,18 +1564,18 @@ struct TALER_AUDITORDB_Plugin
enum GNUNET_DB_QueryStatus
- (*delete_reserve_not_closed_inconsistency)(
+ (*delete_reserve_not_closed_inconsistency)(
void *cls,
uint64_t row_id);
enum GNUNET_DB_QueryStatus
- (*insert_reserve_not_closed_inconsistency)(
+ (*insert_reserve_not_closed_inconsistency)(
void *cls,
const struct TALER_AUDITORDB_ReserveNotClosedInconsistency *dc);
enum GNUNET_DB_QueryStatus
- (*get_denominations_without_sigs)(
+ (*get_denominations_without_sigs)(
void *cls,
int64_t limit,
uint64_t offset,
@@ -1627,18 +1585,18 @@ struct TALER_AUDITORDB_Plugin
enum GNUNET_DB_QueryStatus
- (*delete_denominations_without_sigs)(
+ (*delete_denominations_without_sigs)(
void *cls,
uint64_t row_id);
enum GNUNET_DB_QueryStatus
- (*insert_denominations_without_sigs)(
+ (*insert_denominations_without_sigs)(
void *cls,
const struct TALER_AUDITORDB_DenominationsWithoutSigs *dc);
enum GNUNET_DB_QueryStatus
- (*get_misattribution_in_inconsistency)(
+ (*get_misattribution_in_inconsistency)(
void *cls,
int64_t limit,
uint64_t offset,
@@ -1648,18 +1606,18 @@ struct TALER_AUDITORDB_Plugin
enum GNUNET_DB_QueryStatus
- (*delete_misattribution_in_inconsistency)(
+ (*delete_misattribution_in_inconsistency)(
void *cls,
uint64_t row_id);
enum GNUNET_DB_QueryStatus
- (*insert_misattribution_in_inconsistency)(
+ (*insert_misattribution_in_inconsistency)(
void *cls,
const struct TALER_AUDITORDB_MisattributionInInconsistency *dc);
enum GNUNET_DB_QueryStatus
- (*get_reserves)(
+ (*get_reserves)(
void *cls,
int64_t limit,
uint64_t offset,
@@ -1667,7 +1625,7 @@ struct TALER_AUDITORDB_Plugin
void *cb_cls);
enum GNUNET_DB_QueryStatus
- (*get_purses)(
+ (*get_purses)(
void *cls,
int64_t limit,
uint64_t offset,
@@ -1676,12 +1634,12 @@ struct TALER_AUDITORDB_Plugin
enum GNUNET_DB_QueryStatus
- (*delete_purses)(
+ (*delete_purses)(
void *cls,
uint64_t row_id);
enum GNUNET_DB_QueryStatus
- (*get_denomination_pending)(
+ (*get_denomination_pending)(
void *cls,
int64_t limit,
uint64_t offset,
@@ -1689,17 +1647,17 @@ struct TALER_AUDITORDB_Plugin
void *cb_cls);
enum GNUNET_DB_QueryStatus
- (*delete_denomination_pending)(
+ (*delete_denomination_pending)(
void *cls,
uint64_t row_id);
enum GNUNET_DB_QueryStatus
- (*insert_denomination_pending)(
+ (*insert_denomination_pending)(
void *cls,
const struct TALER_AUDITORDB_DenominationPending *dc);
enum GNUNET_DB_QueryStatus
- (*get_exchange_signkeys)(
+ (*get_exchange_signkeys)(
void *cls,
int64_t limit,
uint64_t offset,
@@ -1708,7 +1666,7 @@ struct TALER_AUDITORDB_Plugin
void *cb_cls);
enum GNUNET_DB_QueryStatus
- (*get_wire_format_inconsistency)(
+ (*get_wire_format_inconsistency)(
void *cls,
int64_t limit,
uint64_t offset,
@@ -1718,18 +1676,18 @@ struct TALER_AUDITORDB_Plugin
enum GNUNET_DB_QueryStatus
- (*delete_wire_format_inconsistency)(
+ (*delete_wire_format_inconsistency)(
void *cls,
uint64_t row_id);
enum GNUNET_DB_QueryStatus
- (*insert_wire_format_inconsistency)(
+ (*insert_wire_format_inconsistency)(
void *cls,
const struct TALER_AUDITORDB_WireFormatInconsistency *dc);
enum GNUNET_DB_QueryStatus
- (*get_wire_out_inconsistency)(
+ (*get_wire_out_inconsistency)(
void *cls,
int64_t limit,
uint64_t offset,
@@ -1739,23 +1697,23 @@ struct TALER_AUDITORDB_Plugin
enum GNUNET_DB_QueryStatus
- (*delete_wire_out_inconsistency)(
+ (*delete_wire_out_inconsistency)(
void *cls,
uint64_t row_id);
enum GNUNET_DB_QueryStatus
- (*insert_wire_out_inconsistency)(
+ (*insert_wire_out_inconsistency)(
void *cls,
const struct TALER_AUDITORDB_WireOutInconsistency *dc);
enum GNUNET_DB_QueryStatus
- (*delete_wire_out_inconsistency_if_matching)(
+ (*delete_wire_out_inconsistency_if_matching)(
void *cls,
const struct TALER_AUDITORDB_WireOutInconsistency *dc);
enum GNUNET_DB_QueryStatus
- (*get_reserve_balance_summary_wrong_inconsistency)(
+ (*get_reserve_balance_summary_wrong_inconsistency)(
void *cls,
int64_t limit,
uint64_t offset,
@@ -1765,18 +1723,18 @@ struct TALER_AUDITORDB_Plugin
enum GNUNET_DB_QueryStatus
- (*delete_reserve_balance_summary_wrong_inconsistency)(
+ (*delete_reserve_balance_summary_wrong_inconsistency)(
void *cls,
uint64_t row_id);
enum GNUNET_DB_QueryStatus
- (*insert_reserve_balance_summary_wrong_inconsistency)(
+ (*insert_reserve_balance_summary_wrong_inconsistency)(
void *cls,
const struct TALER_AUDITORDB_ReserveBalanceSummaryWrongInconsistency *dc);
enum GNUNET_DB_QueryStatus
- (*get_row_minor_inconsistencies)(
+ (*get_row_minor_inconsistencies)(
void *cls,
int64_t limit,
uint64_t offset,
@@ -1786,18 +1744,18 @@ struct TALER_AUDITORDB_Plugin
enum GNUNET_DB_QueryStatus
- (*delete_row_minor_inconsistencies)(
+ (*delete_row_minor_inconsistencies)(
void *cls,
uint64_t row_id);
enum GNUNET_DB_QueryStatus
- (*insert_row_minor_inconsistencies)(
+ (*insert_row_minor_inconsistencies)(
void *cls,
const struct TALER_AUDITORDB_RowMinorInconsistencies *dc);
enum GNUNET_DB_QueryStatus
- (*get_fee_time_inconsistency)(
+ (*get_fee_time_inconsistency)(
void *cls,
int64_t limit,
uint64_t offset,
@@ -1807,13 +1765,13 @@ struct TALER_AUDITORDB_Plugin
enum GNUNET_DB_QueryStatus
- (*delete_fee_time_inconsistency)(
+ (*delete_fee_time_inconsistency)(
void *cls,
uint64_t row_id);
enum GNUNET_DB_QueryStatus
- (*insert_fee_time_inconsistency)(
+ (*insert_fee_time_inconsistency)(
void *cls,
const struct TALER_AUDITORDB_FeeTimeInconsistency *dc);
@@ -1829,7 +1787,7 @@ struct TALER_AUDITORDB_Plugin
* @return transaction status code
*/
enum GNUNET_DB_QueryStatus
- (*insert_reserve_info)(
+ (*insert_reserve_info)(
void *cls,
const struct TALER_ReservePublicKeyP *reserve_pub,
const struct TALER_AUDITORDB_ReserveFeeBalance *rfb,
@@ -1848,7 +1806,7 @@ struct TALER_AUDITORDB_Plugin
* @return transaction status code
*/
enum GNUNET_DB_QueryStatus
- (*update_reserve_info)(
+ (*update_reserve_info)(
void *cls,
const struct TALER_ReservePublicKeyP *reserve_pub,
const struct TALER_AUDITORDB_ReserveFeeBalance *rfb,
@@ -1867,7 +1825,7 @@ struct TALER_AUDITORDB_Plugin
* @return transaction status code
*/
enum GNUNET_DB_QueryStatus
- (*get_reserve_info)(
+ (*get_reserve_info)(
void *cls,
const struct TALER_ReservePublicKeyP *reserve_pub,
uint64_t *rowid,
@@ -1884,8 +1842,8 @@ struct TALER_AUDITORDB_Plugin
* @return transaction status code
*/
enum GNUNET_DB_QueryStatus
- (*del_reserve_info)(void *cls,
- const struct TALER_ReservePublicKeyP *reserve_pub);
+ (*del_reserve_info)(void *cls,
+ const struct TALER_ReservePublicKeyP *reserve_pub);
/**
@@ -1901,7 +1859,7 @@ struct TALER_AUDITORDB_Plugin
* @return transaction status code
*/
enum GNUNET_DB_QueryStatus
- (*insert_early_aggregation)(
+ (*insert_early_aggregation)(
void *cls,
uint64_t batch_deposit_serial_id,
uint64_t tracking_serial_id,
@@ -1918,7 +1876,7 @@ struct TALER_AUDITORDB_Plugin
* @return transaction status code
*/
enum GNUNET_DB_QueryStatus
- (*delete_early_aggregation)(
+ (*delete_early_aggregation)(
void *cls,
uint64_t batch_deposit_serial_id);
@@ -1934,7 +1892,7 @@ struct TALER_AUDITORDB_Plugin
* @return transaction status code
*/
enum GNUNET_DB_QueryStatus
- (*insert_pending_deposit)(
+ (*insert_pending_deposit)(
void *cls,
uint64_t batch_deposit_serial_id,
const struct TALER_FullPaytoHashP *wire_target_h_payto,
@@ -1952,7 +1910,7 @@ struct TALER_AUDITORDB_Plugin
* @return transaction status code
*/
enum GNUNET_DB_QueryStatus
- (*delete_pending_deposit)(
+ (*delete_pending_deposit)(
void *cls,
uint64_t batch_deposit_serial_id);
@@ -1967,7 +1925,7 @@ struct TALER_AUDITORDB_Plugin
* @return transaction status code
*/
enum GNUNET_DB_QueryStatus
- (*select_pending_deposits)(
+ (*select_pending_deposits)(
void *cls,
struct GNUNET_TIME_Absolute deadline,
TALER_AUDITORDB_WireMissingCallback cb,
@@ -1985,7 +1943,7 @@ struct TALER_AUDITORDB_Plugin
* @return transaction status code
*/
enum GNUNET_DB_QueryStatus
- (*insert_purse_info)(
+ (*insert_purse_info)(
void *cls,
const struct TALER_PurseContractPublicKeyP *purse_pub,
const struct TALER_Amount *balance,
@@ -2002,7 +1960,7 @@ struct TALER_AUDITORDB_Plugin
* @return transaction status code
*/
enum GNUNET_DB_QueryStatus
- (*update_purse_info)(
+ (*update_purse_info)(
void *cls,
const struct TALER_PurseContractPublicKeyP *purse_pub,
const struct TALER_Amount *balance);
@@ -2019,7 +1977,7 @@ struct TALER_AUDITORDB_Plugin
* @return transaction status code
*/
enum GNUNET_DB_QueryStatus
- (*get_purse_info)(
+ (*get_purse_info)(
void *cls,
const struct TALER_PurseContractPublicKeyP *purse_pub,
uint64_t *rowid,
@@ -2035,7 +1993,7 @@ struct TALER_AUDITORDB_Plugin
* @return transaction status code
*/
enum GNUNET_DB_QueryStatus
- (*delete_purse_info)(
+ (*delete_purse_info)(
void *cls,
const struct TALER_PurseContractPublicKeyP *purse_pub);
@@ -2049,7 +2007,7 @@ struct TALER_AUDITORDB_Plugin
* @return transaction status code
*/
enum GNUNET_DB_QueryStatus
- (*select_purse_expired)(
+ (*select_purse_expired)(
void *cls,
TALER_AUDITORDB_ExpiredPurseCallback cb,
void *cb_cls);
@@ -2065,7 +2023,7 @@ struct TALER_AUDITORDB_Plugin
* @return transaction status code
*/
enum GNUNET_DB_QueryStatus
- (*insert_denomination_balance)(
+ (*insert_denomination_balance)(
void *cls,
const struct TALER_DenominationHashP *denom_pub_hash,
const struct TALER_AUDITORDB_DenominationCirculationData *dcd);
@@ -2081,7 +2039,7 @@ struct TALER_AUDITORDB_Plugin
* @return transaction status code
*/
enum GNUNET_DB_QueryStatus
- (*update_denomination_balance)(
+ (*update_denomination_balance)(
void *cls,
const struct TALER_DenominationHashP *denom_pub_hash,
const struct TALER_AUDITORDB_DenominationCirculationData *dcd);
@@ -2094,7 +2052,7 @@ struct TALER_AUDITORDB_Plugin
* @return transaction status code
*/
enum GNUNET_DB_QueryStatus
- (*del_denomination_balance)(
+ (*del_denomination_balance)(
void *cls,
const struct TALER_DenominationHashP *denom_pub_hash);
@@ -2108,7 +2066,7 @@ struct TALER_AUDITORDB_Plugin
* @return transaction status code
*/
enum GNUNET_DB_QueryStatus
- (*get_denomination_balance)(
+ (*get_denomination_balance)(
void *cls,
const struct TALER_DenominationHashP *denom_pub_hash,
struct TALER_AUDITORDB_DenominationCirculationData *dcd);
@@ -2128,7 +2086,7 @@ struct TALER_AUDITORDB_Plugin
* @return transaction status code
*/
enum GNUNET_DB_QueryStatus
- (*insert_historic_denom_revenue)(
+ (*insert_historic_denom_revenue)(
void *cls,
const struct TALER_DenominationHashP *denom_pub_hash,
struct GNUNET_TIME_Timestamp revenue_timestamp,
@@ -2145,7 +2103,7 @@ struct TALER_AUDITORDB_Plugin
* @return transaction status code
*/
enum GNUNET_DB_QueryStatus
- (*select_historic_denom_revenue)(
+ (*select_historic_denom_revenue)(
void *cls,
int64_t limit,
uint64_t offset,
@@ -2163,7 +2121,7 @@ struct TALER_AUDITORDB_Plugin
* @return transaction status code
*/
enum GNUNET_DB_QueryStatus
- (*insert_historic_reserve_revenue)(
+ (*insert_historic_reserve_revenue)(
void *cls,
struct GNUNET_TIME_Timestamp start_time,
struct GNUNET_TIME_Timestamp end_time,
@@ -2179,7 +2137,7 @@ struct TALER_AUDITORDB_Plugin
* @return transaction status code
*/
enum GNUNET_DB_QueryStatus
- (*select_historic_reserve_revenue)(
+ (*select_historic_reserve_revenue)(
void *cls,
int64_t limit,
uint64_t offset,
diff --git a/src/include/taler_exchangedb_plugin.h b/src/include/taler_exchangedb_plugin.h
@@ -3053,25 +3053,27 @@ typedef enum GNUNET_GenericReturnValue
*
* @param cls closure
* @param rowid unique serial ID for the refresh session in our DB
- * @param denom_pub denomination public key of @a coin_pub
- * @param h_age_commitment age commitment that went into the signing of the coin, may be NULL
+ * @param old_denom_pub denomination public key of @a coin_pub
* @param coin_pub public key of the coin
* @param coin_sig signature from the coin
+ * @param h_age_commitment hash of the age commitment for the coin
* @param amount_with_fee amount that was deposited including fee
- * @param noreveal_index which index was picked by the exchange in cut-and-choose
- * @param rc what is the commitment
+ * @param num_nds length of the @a new_denom_serials array
+ * @param new_denom_serials array of denomination serials of fresh coins
+ * @param rc what the refresh commitment
* @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop
*/
typedef enum GNUNET_GenericReturnValue
(*TALER_EXCHANGEDB_RefreshesCallback)(
void *cls,
uint64_t rowid,
- const struct TALER_DenominationPublicKey *denom_pub,
- const struct TALER_AgeCommitmentHash *h_age_commitment,
+ const struct TALER_DenominationPublicKey *old_denom_pub,
const struct TALER_CoinSpendPublicKeyP *coin_pub,
const struct TALER_CoinSpendSignatureP *coin_sig,
+ const struct TALER_AgeCommitmentHash *h_age_commitment,
const struct TALER_Amount *amount_with_fee,
- uint32_t noreveal_index,
+ size_t num_nds,
+ uint64_t new_denom_serials[static num_nds],
const struct TALER_RefreshCommitmentP *rc);
diff --git a/src/util/crypto.c b/src/util/crypto.c
@@ -475,15 +475,15 @@ TALER_cs_pub_hash (const struct GNUNET_CRYPTO_CsPublicKey *cs,
enum GNUNET_GenericReturnValue
-TALER_planchet_prepare (const struct TALER_DenominationPublicKey *dk,
- const struct
- TALER_ExchangeBlindingValues *blinding_values,
- const union GNUNET_CRYPTO_BlindingSecretP *bks,
- const union GNUNET_CRYPTO_BlindSessionNonce *nonce,
- const struct TALER_CoinSpendPrivateKeyP *coin_priv,
- const struct TALER_AgeCommitmentHash *ach,
- struct TALER_CoinPubHashP *c_hash,
- struct TALER_PlanchetDetail *pd)
+TALER_planchet_prepare (
+ const struct TALER_DenominationPublicKey *dk,
+ const struct TALER_ExchangeBlindingValues *blinding_values,
+ const union GNUNET_CRYPTO_BlindingSecretP *bks,
+ const union GNUNET_CRYPTO_BlindSessionNonce *nonce,
+ const struct TALER_CoinSpendPrivateKeyP *coin_priv,
+ const struct TALER_AgeCommitmentHash *ach,
+ struct TALER_CoinPubHashP *c_hash,
+ struct TALER_PlanchetDetail *pd)
{
struct TALER_CoinSpendPublicKeyP coin_pub;