diff options
author | Özgür Kesim <oec-taler@kesim.org> | 2023-12-13 14:33:23 +0100 |
---|---|---|
committer | Özgür Kesim <oec-taler@kesim.org> | 2023-12-13 14:33:23 +0100 |
commit | 227dc29fcd78f0cd6b394ff2716c548f9be2adb6 (patch) | |
tree | ce8a2ab1513b940ae3aa9fd368adcc9c321231be | |
parent | d3ed984b0ffa6e0ffad4193f4e881db53ac75565 (diff) |
[wip, #7267] more refined age commitment conflict response during deposit
Distinguish between and communicate:
a) null hash value expected, got non-null
b) non-null hash value expected, got null
c) hash value of known coin differ from given
-rw-r--r-- | src/exchange/taler-exchange-httpd_db.c | 8 | ||||
-rw-r--r-- | src/exchange/taler-exchange-httpd_responses.c | 32 | ||||
-rw-r--r-- | src/exchange/taler-exchange-httpd_responses.h | 3 | ||||
-rw-r--r-- | src/exchangedb/pg_batch_ensure_coin_known.c | 222 | ||||
-rw-r--r-- | src/exchangedb/pg_ensure_coin_known.c | 23 | ||||
-rw-r--r-- | src/include/taler_exchangedb_plugin.h | 812 |
6 files changed, 586 insertions, 514 deletions
diff --git a/src/exchange/taler-exchange-httpd_db.c b/src/exchange/taler-exchange-httpd_db.c index a00a97856..5be12a508 100644 --- a/src/exchange/taler-exchange-httpd_db.c +++ b/src/exchange/taler-exchange-httpd_db.c @@ -22,6 +22,7 @@ #include <pthread.h> #include <jansson.h> #include <gnunet/gnunet_json_lib.h> +#include "taler_exchangedb_plugin.h" #include "taler_json_lib.h" #include "taler_mhd_lib.h" #include "taler_exchangedb_lib.h" @@ -37,7 +38,7 @@ TEH_make_coin_known (const struct TALER_CoinPublicInfo *coin, { enum TALER_EXCHANGEDB_CoinKnownStatus cks; struct TALER_DenominationHashP h_denom_pub; - struct TALER_AgeCommitmentHash h_age_commitment; + struct TALER_AgeCommitmentHash h_age_commitment = {{{0}}}; /* make sure coin is 'known' in database */ cks = TEH_plugin->ensure_coin_known (TEH_plugin->cls, @@ -69,10 +70,13 @@ TEH_make_coin_known (const struct TALER_CoinPublicInfo *coin, &h_denom_pub, &coin->coin_pub); return GNUNET_DB_STATUS_HARD_ERROR; - case TALER_EXCHANGEDB_CKS_AGE_CONFLICT: + case TALER_EXCHANGEDB_CKS_AGE_CONFLICT_EXPECTED_NULL: + case TALER_EXCHANGEDB_CKS_AGE_CONFLICT_EXPECTED_NON_NULL: + case TALER_EXCHANGEDB_CKS_AGE_CONFLICT_VALUE_DIFFERS: *mhd_ret = TEH_RESPONSE_reply_coin_age_commitment_conflict ( connection, TALER_EC_EXCHANGE_GENERIC_COIN_CONFLICTING_AGE_HASH, + cks, &h_denom_pub, &coin->coin_pub, &h_age_commitment); diff --git a/src/exchange/taler-exchange-httpd_responses.c b/src/exchange/taler-exchange-httpd_responses.c index c1aa9db6f..2d8dede51 100644 --- a/src/exchange/taler-exchange-httpd_responses.c +++ b/src/exchange/taler-exchange-httpd_responses.c @@ -23,9 +23,11 @@ * @author Christian Grothoff */ #include "platform.h" +#include <gnunet/gnunet_json_lib.h> #include <microhttpd.h> #include <zlib.h> #include "taler-exchange-httpd_responses.h" +#include "taler_exchangedb_plugin.h" #include "taler_util.h" #include "taler_json_lib.h" #include "taler_mhd_lib.h" @@ -181,10 +183,31 @@ MHD_RESULT TEH_RESPONSE_reply_coin_age_commitment_conflict ( struct MHD_Connection *connection, enum TALER_ErrorCode ec, + enum TALER_EXCHANGEDB_CoinKnownStatus status, const struct TALER_DenominationHashP *h_denom_pub, const struct TALER_CoinSpendPublicKeyP *coin_pub, - const struct TALER_AgeCommitmentHash *h_age_commitment_hash) + const struct TALER_AgeCommitmentHash *h_age_commitment) { + const struct TALER_AgeCommitmentHash *hac = h_age_commitment; + const char *conflict_detail; + + switch (status) + { + + case TALER_EXCHANGEDB_CKS_AGE_CONFLICT_EXPECTED_NULL: + conflict_detail = "expected NULL age commitment hash"; + hac = NULL; + break; + case TALER_EXCHANGEDB_CKS_AGE_CONFLICT_EXPECTED_NON_NULL: + conflict_detail = "unexpected NULL age commitment hash"; + break; + case TALER_EXCHANGEDB_CKS_AGE_CONFLICT_VALUE_DIFFERS: + conflict_detail = "expected age commitment hash differs"; + break; + default: + GNUNET_assert (0); + } + return TALER_MHD_REPLY_JSON_PACK ( connection, TALER_ErrorCode_get_http_status_safe (ec), @@ -193,8 +216,11 @@ TEH_RESPONSE_reply_coin_age_commitment_conflict ( coin_pub), GNUNET_JSON_pack_data_auto ("h_denom_pub", h_denom_pub), - GNUNET_JSON_pack_data_auto ("h_age_commitment_hash", - h_age_commitment_hash) + GNUNET_JSON_pack_allow_null ( + GNUNET_JSON_pack_data_auto ("expected_age_commitment_hash", + hac)), + GNUNET_JSON_pack_string ("conflict_detail", + conflict_detail) ); } diff --git a/src/exchange/taler-exchange-httpd_responses.h b/src/exchange/taler-exchange-httpd_responses.h index 5fe106e17..b10a72824 100644 --- a/src/exchange/taler-exchange-httpd_responses.h +++ b/src/exchange/taler-exchange-httpd_responses.h @@ -31,6 +31,7 @@ #include "taler_error_codes.h" #include "taler-exchange-httpd.h" #include "taler-exchange-httpd_db.h" +#include "taler_exchangedb_plugin.h" /** @@ -167,6 +168,7 @@ TEH_RESPONSE_reply_coin_insufficient_funds ( * * @param connection connection to the client * @param ec error code to return + * @param cks specific conflict type * @param h_denom_pub hash of the denomination of the coin * @param coin_pub public key of the coin * @param h_age_commitment hash of the age commitment as found in the database @@ -176,6 +178,7 @@ MHD_RESULT TEH_RESPONSE_reply_coin_age_commitment_conflict ( struct MHD_Connection *connection, enum TALER_ErrorCode ec, + enum TALER_EXCHANGEDB_CoinKnownStatus cks, const struct TALER_DenominationHashP *h_denom_pub, const struct TALER_CoinSpendPublicKeyP *coin_pub, const struct TALER_AgeCommitmentHash *h_age_commitment); diff --git a/src/exchangedb/pg_batch_ensure_coin_known.c b/src/exchangedb/pg_batch_ensure_coin_known.c index e49813064..aca2732c6 100644 --- a/src/exchangedb/pg_batch_ensure_coin_known.c +++ b/src/exchangedb/pg_batch_ensure_coin_known.c @@ -17,10 +17,14 @@ * @file exchangedb/pg_batch_ensure_coin_known.c * @brief Implementation of the batch_ensure_coin_known function for Postgres * @author Christian Grothoff + * + * FIXME: use the array support for postgres to simplify this code! + * */ #include "platform.h" #include "taler_error_codes.h" #include "taler_dbevents.h" +#include "taler_exchangedb_plugin.h" #include "taler_pq_lib.h" #include "pg_batch_ensure_coin_known.h" #include "pg_helper.h" @@ -93,14 +97,37 @@ insert1 (struct PostgresClosure *pg, result[0].denom_conflict = true; } - if ( (! is_age_hash_null) && - (0 != GNUNET_memcmp (&result[0].h_age_commitment, - &coin->h_age_commitment)) ) + if ( (! is_denom_pub_hash_null) && + (0 != GNUNET_memcmp (&result[0].denom_hash, + &coin[0].denom_pub_hash)) ) + { + GNUNET_break_op (0); + result[0].denom_conflict = true; + } + + result[0].age_conflict = TALER_AgeCommitmentHash_NoConflict; + + if (is_age_hash_null != coin[0].no_age_commitment) + { + if (is_age_hash_null) + { + GNUNET_break_op (0); + result[0].age_conflict = TALER_AgeCommitmentHash_NullExpected; + } + else + { + GNUNET_break_op (0); + result[0].age_conflict = TALER_AgeCommitmentHash_ValueExpected; + } + } + else if ( (! is_age_hash_null) && + (0 != GNUNET_memcmp (&result[0].h_age_commitment, + &coin[0].h_age_commitment)) ) { - GNUNET_break (GNUNET_is_zero (&result[0].h_age_commitment)); GNUNET_break_op (0); - result[0].age_conflict = true; + result[0].age_conflict = TALER_AgeCommitmentHash_ValueDiffers; } + return qs; } @@ -111,10 +138,8 @@ insert2 (struct PostgresClosure *pg, struct TALER_EXCHANGEDB_CoinInfo result[2]) { enum GNUNET_DB_QueryStatus qs; - bool is_denom_pub_hash_null = false; - bool is_age_hash_null = false; - bool is_denom_pub_hash_null2 = false; - bool is_age_hash_null2 = false; + bool is_denom_pub_hash_null[2] = {false, false}; + bool is_age_hash_null[2] = {false, false}; PREPARE (pg, "batch2_known_coin", @@ -150,11 +175,11 @@ insert2 (struct PostgresClosure *pg, GNUNET_PQ_result_spec_allow_null ( GNUNET_PQ_result_spec_auto_from_type ("denom_pub_hash", &result[0].denom_hash), - &is_denom_pub_hash_null), + &is_denom_pub_hash_null[0]), GNUNET_PQ_result_spec_allow_null ( GNUNET_PQ_result_spec_auto_from_type ("age_commitment_hash", &result[0].h_age_commitment), - &is_age_hash_null), + &is_age_hash_null[0]), GNUNET_PQ_result_spec_bool ("existed2", &result[1].existed), GNUNET_PQ_result_spec_uint64 ("known_coin_id2", @@ -162,11 +187,11 @@ insert2 (struct PostgresClosure *pg, GNUNET_PQ_result_spec_allow_null ( GNUNET_PQ_result_spec_auto_from_type ("denom_pub_hash2", &result[1].denom_hash), - &is_denom_pub_hash_null2), + &is_denom_pub_hash_null[1]), GNUNET_PQ_result_spec_allow_null ( GNUNET_PQ_result_spec_auto_from_type ("age_commitment_hash2", &result[1].h_age_commitment), - &is_age_hash_null2), + &is_age_hash_null[1]), GNUNET_PQ_result_spec_end }; @@ -188,38 +213,40 @@ insert2 (struct PostgresClosure *pg, break; /* continued below */ } - if ( (! is_denom_pub_hash_null) && - (0 != GNUNET_memcmp (&result[0].denom_hash, - &coin[0].denom_pub_hash)) ) + for (int i = 0; i < 2; i++) { - GNUNET_break_op (0); - result[0].denom_conflict = true; - } + if ( (! is_denom_pub_hash_null[i]) && + (0 != GNUNET_memcmp (&result[i].denom_hash, + &coin[i].denom_pub_hash)) ) + { + GNUNET_break_op (0); + result[i].denom_conflict = true; + } - if ( (! is_age_hash_null) && - (0 != GNUNET_memcmp (&result[0].h_age_commitment, - &coin[0].h_age_commitment)) ) - { - GNUNET_break (GNUNET_is_zero (&result[0].h_age_commitment)); - GNUNET_break_op (0); - result[0].age_conflict = true; - } - if ( (! is_denom_pub_hash_null2) && - (0 != GNUNET_memcmp (&result[1].denom_hash, - &coin[1].denom_pub_hash)) ) - { - GNUNET_break_op (0); - result[1].denom_conflict = true; - } + result[i].age_conflict = TALER_AgeCommitmentHash_NoConflict; - if ( (! is_age_hash_null) && - (0 != GNUNET_memcmp (&result[1].h_age_commitment, - &coin[1].h_age_commitment)) ) - { - GNUNET_break (GNUNET_is_zero (&result[1].h_age_commitment)); - GNUNET_break_op (0); - result[1].age_conflict = true; + if (is_age_hash_null[i] != coin[i].no_age_commitment) + { + if (is_age_hash_null[i]) + { + GNUNET_break_op (0); + result[i].age_conflict = TALER_AgeCommitmentHash_NullExpected; + } + else + { + GNUNET_break_op (0); + result[i].age_conflict = TALER_AgeCommitmentHash_ValueExpected; + } + } + else if ( (! is_age_hash_null[i]) && + (0 != GNUNET_memcmp (&result[i].h_age_commitment, + &coin[i].h_age_commitment)) ) + { + GNUNET_break_op (0); + result[i].age_conflict = TALER_AgeCommitmentHash_ValueDiffers; + } } + return qs; } @@ -230,14 +257,8 @@ insert4 (struct PostgresClosure *pg, struct TALER_EXCHANGEDB_CoinInfo result[4]) { enum GNUNET_DB_QueryStatus qs; - bool is_denom_pub_hash_null = false; - bool is_age_hash_null = false; - bool is_denom_pub_hash_null2 = false; - bool is_age_hash_null2 = false; - bool is_denom_pub_hash_null3 = false; - bool is_age_hash_null3 = false; - bool is_denom_pub_hash_null4 = false; - bool is_age_hash_null4 = false; + bool is_denom_pub_hash_null[4] = {false, false, false, false}; + bool is_age_hash_null[4] = {false, false, false, false}; PREPARE (pg, "batch4_known_coin", "SELECT" @@ -290,11 +311,11 @@ insert4 (struct PostgresClosure *pg, GNUNET_PQ_result_spec_allow_null ( GNUNET_PQ_result_spec_auto_from_type ("denom_pub_hash", &result[0].denom_hash), - &is_denom_pub_hash_null), + &is_denom_pub_hash_null[0]), GNUNET_PQ_result_spec_allow_null ( GNUNET_PQ_result_spec_auto_from_type ("age_commitment_hash", &result[0].h_age_commitment), - &is_age_hash_null), + &is_age_hash_null[0]), GNUNET_PQ_result_spec_bool ("existed2", &result[1].existed), GNUNET_PQ_result_spec_uint64 ("known_coin_id2", @@ -302,11 +323,11 @@ insert4 (struct PostgresClosure *pg, GNUNET_PQ_result_spec_allow_null ( GNUNET_PQ_result_spec_auto_from_type ("denom_pub_hash2", &result[1].denom_hash), - &is_denom_pub_hash_null2), + &is_denom_pub_hash_null[1]), GNUNET_PQ_result_spec_allow_null ( GNUNET_PQ_result_spec_auto_from_type ("age_commitment_hash2", &result[1].h_age_commitment), - &is_age_hash_null2), + &is_age_hash_null[1]), GNUNET_PQ_result_spec_bool ("existed3", &result[2].existed), GNUNET_PQ_result_spec_uint64 ("known_coin_id3", @@ -314,11 +335,11 @@ insert4 (struct PostgresClosure *pg, GNUNET_PQ_result_spec_allow_null ( GNUNET_PQ_result_spec_auto_from_type ("denom_pub_hash3", &result[2].denom_hash), - &is_denom_pub_hash_null3), + &is_denom_pub_hash_null[2]), GNUNET_PQ_result_spec_allow_null ( GNUNET_PQ_result_spec_auto_from_type ("age_commitment_hash3", &result[2].h_age_commitment), - &is_age_hash_null3), + &is_age_hash_null[2]), GNUNET_PQ_result_spec_bool ("existed4", &result[3].existed), GNUNET_PQ_result_spec_uint64 ("known_coin_id4", @@ -326,11 +347,11 @@ insert4 (struct PostgresClosure *pg, GNUNET_PQ_result_spec_allow_null ( GNUNET_PQ_result_spec_auto_from_type ("denom_pub_hash4", &result[3].denom_hash), - &is_denom_pub_hash_null4), + &is_denom_pub_hash_null[3]), GNUNET_PQ_result_spec_allow_null ( GNUNET_PQ_result_spec_auto_from_type ("age_commitment_hash4", &result[3].h_age_commitment), - &is_age_hash_null4), + &is_age_hash_null[3]), GNUNET_PQ_result_spec_end }; @@ -352,69 +373,40 @@ insert4 (struct PostgresClosure *pg, break; /* continued below */ } - if ( (! is_denom_pub_hash_null) && - (0 != GNUNET_memcmp (&result[0].denom_hash, - &coin[0].denom_pub_hash)) ) + for (int i = 0; i < 4; i++) { - GNUNET_break_op (0); - result[0].denom_conflict = true; - } - if ( (! is_age_hash_null) && - (0 != GNUNET_memcmp (&result[0].h_age_commitment, - &coin[0].h_age_commitment)) ) - { - GNUNET_break (GNUNET_is_zero (&result[0].h_age_commitment)); - GNUNET_break_op (0); - result[0].age_conflict = true; - } + if ( (! is_denom_pub_hash_null[i]) && + (0 != GNUNET_memcmp (&result[i].denom_hash, + &coin[i].denom_pub_hash)) ) + { + GNUNET_break_op (0); + result[i].denom_conflict = true; + } - if ( (! is_denom_pub_hash_null2) && - (0 != GNUNET_memcmp (&result[1].denom_hash, - &coin[1].denom_pub_hash)) ) - { - GNUNET_break_op (0); - result[1].denom_conflict = true; - } - if ( (! is_age_hash_null2) && - (0 != GNUNET_memcmp (&result[1].h_age_commitment, - &coin[1].h_age_commitment)) ) - { - GNUNET_break (GNUNET_is_zero (&result[1].h_age_commitment)); - GNUNET_break_op (0); - result[1].age_conflict = true; - } + result[i].age_conflict = TALER_AgeCommitmentHash_NoConflict; - if ( (! is_denom_pub_hash_null3) && - (0 != GNUNET_memcmp (&result[2].denom_hash, - &coin[2].denom_pub_hash)) ) - { - GNUNET_break_op (0); - result[2].denom_conflict = true; - } - if ( (! is_age_hash_null3) && - (0 != GNUNET_memcmp (&result[2].h_age_commitment, - &coin[2].h_age_commitment)) ) - { - GNUNET_break (GNUNET_is_zero (&result[2].h_age_commitment)); - GNUNET_break_op (0); - result[2].age_conflict = true; + if (is_age_hash_null[i] != coin[i].no_age_commitment) + { + if (is_age_hash_null[i]) + { + GNUNET_break_op (0); + result[i].age_conflict = TALER_AgeCommitmentHash_NullExpected; + } + else + { + GNUNET_break_op (0); + result[i].age_conflict = TALER_AgeCommitmentHash_ValueExpected; + } + } + else if ( (! is_age_hash_null[i]) && + (0 != GNUNET_memcmp (&result[i].h_age_commitment, + &coin[i].h_age_commitment)) ) + { + GNUNET_break_op (0); + result[i].age_conflict = TALER_AgeCommitmentHash_ValueDiffers; + } } - if ( (! is_denom_pub_hash_null4) && - (0 != GNUNET_memcmp (&result[3].denom_hash, - &coin[3].denom_pub_hash)) ) - { - GNUNET_break_op (0); - result[3].denom_conflict = true; - } - if ( (! is_age_hash_null4) && - (0 != GNUNET_memcmp (&result[3].h_age_commitment, - &coin[3].h_age_commitment)) ) - { - GNUNET_break (GNUNET_is_zero (&result[3].h_age_commitment)); - GNUNET_break_op (0); - result[3].age_conflict = true; - } return qs; } diff --git a/src/exchangedb/pg_ensure_coin_known.c b/src/exchangedb/pg_ensure_coin_known.c index 952acf24f..307b8df52 100644 --- a/src/exchangedb/pg_ensure_coin_known.c +++ b/src/exchangedb/pg_ensure_coin_known.c @@ -21,6 +21,7 @@ #include "platform.h" #include "taler_error_codes.h" #include "taler_dbevents.h" +#include "taler_exchangedb_plugin.h" #include "taler_pq_lib.h" #include "pg_ensure_coin_known.h" #include "pg_helper.h" @@ -143,13 +144,25 @@ TEH_PG_ensure_coin_known (void *cls, return TALER_EXCHANGEDB_CKS_DENOM_CONFLICT; } - if ( (! is_age_hash_null) && - (0 != GNUNET_memcmp (h_age_commitment, - &coin->h_age_commitment)) ) + if (is_age_hash_null != coin->no_age_commitment) + { + if (is_age_hash_null) + { + GNUNET_break_op (0); + return TALER_EXCHANGEDB_CKS_AGE_CONFLICT_EXPECTED_NULL; + } + else + { + GNUNET_break_op (0); + return TALER_EXCHANGEDB_CKS_AGE_CONFLICT_EXPECTED_NON_NULL; + } + } + else if ( (! is_age_hash_null) && + (0 != GNUNET_memcmp (h_age_commitment, + &coin->h_age_commitment)) ) { - GNUNET_break (GNUNET_is_zero (h_age_commitment)); GNUNET_break_op (0); - return TALER_EXCHANGEDB_CKS_AGE_CONFLICT; + return TALER_EXCHANGEDB_CKS_AGE_CONFLICT_VALUE_DIFFERS; } return TALER_EXCHANGEDB_CKS_PRESENT; diff --git a/src/include/taler_exchangedb_plugin.h b/src/include/taler_exchangedb_plugin.h index 6da278637..596764b1c 100644 --- a/src/include/taler_exchangedb_plugin.h +++ b/src/include/taler_exchangedb_plugin.h @@ -29,6 +29,23 @@ #include "taler_signatures.h" #include "taler_extensions_policy.h" +/** + * The conflict that can occur for the age restriction + */ +enum TALER_EXCHANGEDB_AgeCommitmentHash_Conflict +{ + /* Value OK, no conflict */ + TALER_AgeCommitmentHash_NoConflict = 0, + + /* Given hash had a value, but NULL (or zero) was expected */ + TALER_AgeCommitmentHash_NullExpected = 1, + + /* Given hash was NULL, but value was expected */ + TALER_AgeCommitmentHash_ValueExpected = 2, + + /* Given hash differs from value in the known coin */ + TALER_AgeCommitmentHash_ValueDiffers = 3, +}; /** * Per-coin information returned when doing a batch insert. @@ -63,11 +80,12 @@ struct TALER_EXCHANGEDB_CoinInfo bool denom_conflict; /** - * True if the known coin has a different age restriction; + * Indicates if and what kind of conflict with the age + * restriction of the known coin was present; * application will find age commitment of the already * known coin in @e h_age_commitment. */ - bool age_conflict; + enum TALER_EXCHANGEDB_AgeCommitmentHash_Conflict age_conflict; }; @@ -3538,7 +3556,7 @@ struct TALER_EXCHANGEDB_Plugin * @return #GNUNET_OK upon success; #GNUNET_SYSERR upon failure */ enum GNUNET_GenericReturnValue - (*drop_tables)(void *cls); + (*drop_tables)(void *cls); /** * Create the necessary tables if they are not present @@ -3551,9 +3569,9 @@ struct TALER_EXCHANGEDB_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); /** @@ -3565,8 +3583,8 @@ struct TALER_EXCHANGEDB_Plugin * @return #GNUNET_OK on success */ enum GNUNET_GenericReturnValue - (*start)(void *cls, - const char *name); + (*start)(void *cls, + const char *name); /** @@ -3578,8 +3596,8 @@ struct TALER_EXCHANGEDB_Plugin * @return #GNUNET_OK on success */ enum GNUNET_GenericReturnValue - (*start_read_committed)(void *cls, - const char *name); + (*start_read_committed)(void *cls, + const char *name); /** * Start a READ ONLY serializable transaction. @@ -3590,8 +3608,8 @@ struct TALER_EXCHANGEDB_Plugin * @return #GNUNET_OK on success */ enum GNUNET_GenericReturnValue - (*start_read_only)(void *cls, - const char *name); + (*start_read_only)(void *cls, + const char *name); /** @@ -3601,7 +3619,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status */ enum GNUNET_DB_QueryStatus - (*commit)(void *cls); + (*commit)(void *cls); /** @@ -3615,7 +3633,7 @@ struct TALER_EXCHANGEDB_Plugin * #GNUNET_SYSERR on hard errors */ enum GNUNET_GenericReturnValue - (*preflight)(void *cls); + (*preflight)(void *cls); /** @@ -3682,7 +3700,7 @@ struct TALER_EXCHANGEDB_Plugin * @return status of the query */ enum GNUNET_DB_QueryStatus - (*insert_denomination_info)( + (*insert_denomination_info)( void *cls, const struct TALER_DenominationPublicKey *denom_pub, const struct TALER_EXCHANGEDB_DenominationKeyInformation *issue); @@ -3697,7 +3715,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*get_denomination_info)( + (*get_denomination_info)( void *cls, const struct TALER_DenominationHashP *denom_pub_hash, struct TALER_EXCHANGEDB_DenominationKeyInformation *issue); @@ -3715,9 +3733,9 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*iterate_denomination_info)(void *cls, - TALER_EXCHANGEDB_DenominationCallback cb, - void *cb_cls); + (*iterate_denomination_info)(void *cls, + TALER_EXCHANGEDB_DenominationCallback cb, + void *cb_cls); /** @@ -3731,9 +3749,9 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*iterate_denominations)(void *cls, - TALER_EXCHANGEDB_DenominationsCallback cb, - void *cb_cls); + (*iterate_denominations)(void *cls, + TALER_EXCHANGEDB_DenominationsCallback cb, + void *cb_cls); /** * Function called to invoke @a cb on every non-revoked exchange signing key @@ -3746,9 +3764,9 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*iterate_active_signkeys)(void *cls, - TALER_EXCHANGEDB_ActiveSignkeysCallback cb, - void *cb_cls); + (*iterate_active_signkeys)(void *cls, + TALER_EXCHANGEDB_ActiveSignkeysCallback cb, + void *cb_cls); /** @@ -3761,9 +3779,9 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*iterate_active_auditors)(void *cls, - TALER_EXCHANGEDB_AuditorsCallback cb, - void *cb_cls); + (*iterate_active_auditors)(void *cls, + TALER_EXCHANGEDB_AuditorsCallback cb, + void *cb_cls); /** @@ -3777,7 +3795,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*iterate_auditor_denominations)( + (*iterate_auditor_denominations)( void *cls, TALER_EXCHANGEDB_AuditorDenominationsCallback cb, void *cb_cls); @@ -3793,8 +3811,8 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status */ enum GNUNET_DB_QueryStatus - (*reserves_get)(void *cls, - struct TALER_EXCHANGEDB_Reserve *reserve); + (*reserves_get)(void *cls, + struct TALER_EXCHANGEDB_Reserve *reserve); /** @@ -3806,7 +3824,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status */ enum GNUNET_DB_QueryStatus - (*reserves_get_origin)( + (*reserves_get_origin)( void *cls, const struct TALER_ReservePublicKeyP *reserve_pub, struct TALER_PaytoHashP *h_payto); @@ -3821,9 +3839,9 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status */ enum GNUNET_DB_QueryStatus - (*drain_kyc_alert)(void *cls, - uint32_t trigger_type, - struct TALER_PaytoHashP *h_payto); + (*drain_kyc_alert)(void *cls, + uint32_t trigger_type, + struct TALER_PaytoHashP *h_payto); /** @@ -3837,7 +3855,7 @@ struct TALER_EXCHANGEDB_Plugin * set to the status of the */ enum GNUNET_DB_QueryStatus - (*reserves_in_insert)( + (*reserves_in_insert)( void *cls, const struct TALER_EXCHANGEDB_ReserveInInfo *reserves, unsigned int reserves_length, @@ -3854,10 +3872,10 @@ struct TALER_EXCHANGEDB_Plugin * @return statement execution status */ enum GNUNET_DB_QueryStatus - (*lock_nonce)(void *cls, - const struct GNUNET_CRYPTO_CsSessionNonce *nonce, - const struct TALER_DenominationHashP *denom_pub_hash, - const union TALER_EXCHANGEDB_NonceLockTargetP *target); + (*lock_nonce)(void *cls, + const struct GNUNET_CRYPTO_CsSessionNonce *nonce, + const struct TALER_DenominationHashP *denom_pub_hash, + const union TALER_EXCHANGEDB_NonceLockTargetP *target); /** @@ -3872,9 +3890,10 @@ struct TALER_EXCHANGEDB_Plugin * @return statement execution status */ enum GNUNET_DB_QueryStatus - (*get_withdraw_info)(void *cls, - const struct TALER_BlindedCoinHashP *bch, - struct TALER_EXCHANGEDB_CollectableBlindcoin *collectable); + (*get_withdraw_info)(void *cls, + const struct TALER_BlindedCoinHashP *bch, + struct TALER_EXCHANGEDB_CollectableBlindcoin * + collectable); /** @@ -3905,7 +3924,7 @@ struct TALER_EXCHANGEDB_Plugin * @return query execution status */ enum GNUNET_DB_QueryStatus - (*do_batch_withdraw)( + (*do_batch_withdraw)( void *cls, struct GNUNET_TIME_Timestamp now, const struct TALER_ReservePublicKeyP *reserve_pub, @@ -3934,7 +3953,7 @@ struct TALER_EXCHANGEDB_Plugin * @return query execution status */ enum GNUNET_DB_QueryStatus - (*do_batch_withdraw_insert)( + (*do_batch_withdraw_insert)( void *cls, const union GNUNET_CRYPTO_BlindSessionNonce *nonce, const struct TALER_EXCHANGEDB_CollectableBlindcoin *collectable, @@ -3956,7 +3975,7 @@ struct TALER_EXCHANGEDB_Plugin * @return statement execution status */ enum GNUNET_DB_QueryStatus - (*get_age_withdraw)( + (*get_age_withdraw)( void *cls, const struct TALER_ReservePublicKeyP *reserve_pub, const struct TALER_AgeWithdrawCommitmentHashP *ach, @@ -3978,7 +3997,7 @@ struct TALER_EXCHANGEDB_Plugin * @return query execution status */ enum GNUNET_DB_QueryStatus - (*do_age_withdraw)( + (*do_age_withdraw)( void *cls, const struct TALER_EXCHANGEDB_AgeWithdraw *commitment, struct GNUNET_TIME_Timestamp now, @@ -3999,7 +4018,7 @@ struct TALER_EXCHANGEDB_Plugin * @return query execution status */ enum GNUNET_DB_QueryStatus - (*get_policy_details)( + (*get_policy_details)( void *cls, const struct GNUNET_HashCode *hc, struct TALER_PolicyDetails *detail); @@ -4017,7 +4036,7 @@ struct TALER_EXCHANGEDB_Plugin * @return query execution status */ enum GNUNET_DB_QueryStatus - (*persist_policy_details)( + (*persist_policy_details)( void *cls, const struct TALER_PolicyDetails *details, uint64_t *policy_details_serial_id, @@ -4039,7 +4058,7 @@ struct TALER_EXCHANGEDB_Plugin * @return query execution status */ enum GNUNET_DB_QueryStatus - (*do_deposit)( + (*do_deposit)( void *cls, const struct TALER_EXCHANGEDB_BatchDeposit *bd, struct GNUNET_TIME_Timestamp *exchange_timestamp, @@ -4062,7 +4081,7 @@ struct TALER_EXCHANGEDB_Plugin * @return query execution status */ enum GNUNET_DB_QueryStatus - (*do_melt)( + (*do_melt)( void *cls, const struct TALER_RefreshMasterSecretP *rms, struct TALER_EXCHANGEDB_Refresh *refresh, @@ -4079,7 +4098,7 @@ struct TALER_EXCHANGEDB_Plugin * @return query execution status */ enum GNUNET_DB_QueryStatus - (*add_policy_fulfillment_proof)( + (*add_policy_fulfillment_proof)( void *cls, struct TALER_PolicyFulfillmentTransactionData *fulfillment); @@ -4098,7 +4117,7 @@ struct TALER_EXCHANGEDB_Plugin * @return query execution status */ enum GNUNET_DB_QueryStatus - (*cs_refreshes_reveal)( + (*cs_refreshes_reveal)( void *cls, const struct GNUNET_CRYPTO_CsSessionNonce *nonce, const struct TALER_CoinSpendPublicKeyP *old_coin_pub, @@ -4121,7 +4140,7 @@ struct TALER_EXCHANGEDB_Plugin * @return query execution status */ enum GNUNET_DB_QueryStatus - (*do_refund)( + (*do_refund)( void *cls, const struct TALER_EXCHANGEDB_Refund *refund, const struct TALER_Amount *deposit_fee, @@ -4149,7 +4168,7 @@ struct TALER_EXCHANGEDB_Plugin * @return query execution status */ enum GNUNET_DB_QueryStatus - (*do_recoup)( + (*do_recoup)( void *cls, const struct TALER_ReservePublicKeyP *reserve_pub, uint64_t reserve_out_serial_id, @@ -4179,7 +4198,7 @@ struct TALER_EXCHANGEDB_Plugin * @return query execution status */ enum GNUNET_DB_QueryStatus - (*do_recoup_refresh)( + (*do_recoup_refresh)( void *cls, const struct TALER_CoinSpendPublicKeyP *old_coin_pub, uint64_t rrc_serial, @@ -4210,13 +4229,13 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status */ enum GNUNET_DB_QueryStatus - (*get_reserve_history)(void *cls, - const struct TALER_ReservePublicKeyP *reserve_pub, - uint64_t start_off, - uint64_t etag_in, - uint64_t *etag_out, - struct TALER_Amount *balance, - struct TALER_EXCHANGEDB_ReserveHistory **rhp); + (*get_reserve_history)(void *cls, + const struct TALER_ReservePublicKeyP *reserve_pub, + uint64_t start_off, + uint64_t etag_in, + uint64_t *etag_out, + struct TALER_Amount *balance, + struct TALER_EXCHANGEDB_ReserveHistory **rhp); /** @@ -4228,9 +4247,9 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status */ enum GNUNET_DB_QueryStatus - (*get_reserve_balance)(void *cls, - const struct TALER_ReservePublicKeyP *reserve_pub, - struct TALER_Amount *balance); + (*get_reserve_balance)(void *cls, + const struct TALER_ReservePublicKeyP *reserve_pub, + struct TALER_Amount *balance); /** @@ -4294,9 +4313,20 @@ struct TALER_EXCHANGEDB_Plugin TALER_EXCHANGEDB_CKS_DENOM_CONFLICT = -3, /** + * Conflicting coin (expected NULL age hash) already in database. + */ + TALER_EXCHANGEDB_CKS_AGE_CONFLICT_EXPECTED_NULL = -4, + + /** + * Conflicting coin (unexpected NULL age hash) already in database. + */ + TALER_EXCHANGEDB_CKS_AGE_CONFLICT_EXPECTED_NON_NULL = -5, + + /** * Conflicting coin (different age hash) already in database. */ - TALER_EXCHANGEDB_CKS_AGE_CONFLICT = -4, + TALER_EXCHANGEDB_CKS_AGE_CONFLICT_VALUE_DIFFERS = -6, + } (*ensure_coin_known)(void *cls, const struct TALER_CoinPublicInfo *coin, @@ -4316,7 +4346,7 @@ struct TALER_EXCHANGEDB_Plugin * @return database transaction status, non-negative on success */ enum GNUNET_DB_QueryStatus - (*batch_ensure_coin_known)( + (*batch_ensure_coin_known)( void *cls, const struct TALER_CoinPublicInfo *coin, struct TALER_EXCHANGEDB_CoinInfo *result, @@ -4332,9 +4362,9 @@ struct TALER_EXCHANGEDB_Plugin * @return database transaction status, non-negative on success */ enum GNUNET_DB_QueryStatus - (*get_known_coin)(void *cls, - const struct TALER_CoinSpendPublicKeyP *coin_pub, - struct TALER_CoinPublicInfo *coin_info); + (*get_known_coin)(void *cls, + const struct TALER_CoinSpendPublicKeyP *coin_pub, + struct TALER_CoinPublicInfo *coin_info); /** @@ -4347,10 +4377,10 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*get_coin_denomination)(void *cls, - const struct TALER_CoinSpendPublicKeyP *coin_pub, - uint64_t *known_coin_id, - struct TALER_DenominationHashP *denom_hash); + (*get_coin_denomination)(void *cls, + const struct TALER_CoinSpendPublicKeyP *coin_pub, + uint64_t *known_coin_id, + struct TALER_DenominationHashP *denom_hash); /** @@ -4370,7 +4400,7 @@ struct TALER_EXCHANGEDB_Plugin */ // FIXME: rename! enum GNUNET_DB_QueryStatus - (*have_deposit2)( + (*have_deposit2)( void *cls, const struct TALER_PrivateContractHashP *h_contract_terms, const struct TALER_MerchantWireHashP *h_wire, @@ -4390,8 +4420,8 @@ struct TALER_EXCHANGEDB_Plugin * @return query result status */ enum GNUNET_DB_QueryStatus - (*insert_refund)(void *cls, - const struct TALER_EXCHANGEDB_Refund *refund); + (*insert_refund)(void *cls, + const struct TALER_EXCHANGEDB_Refund *refund); /** @@ -4406,12 +4436,14 @@ struct TALER_EXCHANGEDB_Plugin * @return query result status */ enum GNUNET_DB_QueryStatus - (*select_refunds_by_coin)(void *cls, - const struct TALER_CoinSpendPublicKeyP *coin_pub, - const struct TALER_MerchantPublicKeyP *merchant_pub, - const struct TALER_PrivateContractHashP *h_contract, - TALER_EXCHANGEDB_RefundCoinCallback cb, - void *cb_cls); + (*select_refunds_by_coin)(void *cls, + const struct TALER_CoinSpendPublicKeyP *coin_pub, + const struct + TALER_MerchantPublicKeyP *merchant_pub, + const struct + TALER_PrivateContractHashP *h_contract, + TALER_EXCHANGEDB_RefundCoinCallback cb, + void *cb_cls); /** @@ -4428,11 +4460,11 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*get_ready_deposit)(void *cls, - uint64_t start_shard_row, - uint64_t end_shard_row, - struct TALER_MerchantPublicKeyP *merchant_pub, - char **payto_uri); + (*get_ready_deposit)(void *cls, + uint64_t start_shard_row, + uint64_t end_shard_row, + struct TALER_MerchantPublicKeyP *merchant_pub, + char **payto_uri); /** @@ -4447,7 +4479,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status */ enum GNUNET_DB_QueryStatus - (*aggregate)( + (*aggregate)( void *cls, const struct TALER_PaytoHashP *h_payto, const struct TALER_MerchantPublicKeyP *merchant_pub, @@ -4468,7 +4500,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status */ enum GNUNET_DB_QueryStatus - (*create_aggregation_transient)( + (*create_aggregation_transient)( void *cls, const struct TALER_PaytoHashP *h_payto, const char *exchange_account_section, @@ -4490,7 +4522,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status */ enum GNUNET_DB_QueryStatus - (*select_aggregation_transient)( + (*select_aggregation_transient)( void *cls, const struct TALER_PaytoHashP *h_payto, const struct TALER_MerchantPublicKeyP *merchant_pub, @@ -4509,7 +4541,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status */ enum GNUNET_DB_QueryStatus - (*find_aggregation_transient)( + (*find_aggregation_transient)( void *cls, const struct TALER_PaytoHashP *h_payto, TALER_EXCHANGEDB_TransientAggregationCallback cb, @@ -4528,7 +4560,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status */ enum GNUNET_DB_QueryStatus - (*update_aggregation_transient)( + (*update_aggregation_transient)( void *cls, const struct TALER_PaytoHashP *h_payto, const struct TALER_WireTransferIdentifierRawP *wtid, @@ -4546,7 +4578,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status */ enum GNUNET_DB_QueryStatus - (*delete_aggregation_transient)( + (*delete_aggregation_transient)( void *cls, const struct TALER_PaytoHashP *h_payto, const struct TALER_WireTransferIdentifierRawP *wtid); @@ -4564,10 +4596,10 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status */ enum GNUNET_DB_QueryStatus - (*get_melt)(void *cls, - const struct TALER_RefreshCommitmentP *rc, - struct TALER_EXCHANGEDB_Melt *melt, - uint64_t *melt_serial_id); + (*get_melt)(void *cls, + const struct TALER_RefreshCommitmentP *rc, + struct TALER_EXCHANGEDB_Melt *melt, + uint64_t *melt_serial_id); /** @@ -4585,7 +4617,7 @@ struct TALER_EXCHANGEDB_Plugin * @return query status for the transaction */ enum GNUNET_DB_QueryStatus - (*insert_refresh_reveal)( + (*insert_refresh_reveal)( void *cls, uint64_t melt_serial_id, uint32_t num_rrcs, @@ -4606,10 +4638,10 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status */ enum GNUNET_DB_QueryStatus - (*get_refresh_reveal)(void *cls, - const struct TALER_RefreshCommitmentP *rc, - TALER_EXCHANGEDB_RefreshCallback cb, - void *cb_cls); + (*get_refresh_reveal)(void *cls, + const struct TALER_RefreshCommitmentP *rc, + TALER_EXCHANGEDB_RefreshCallback cb, + void *cb_cls); /** @@ -4625,10 +4657,10 @@ struct TALER_EXCHANGEDB_Plugin * @return statement execution status */ enum GNUNET_DB_QueryStatus - (*get_link_data)(void *cls, - const struct TALER_CoinSpendPublicKeyP *coin_pub, - TALER_EXCHANGEDB_LinkCallback ldc, - void *tdc_cls); + (*get_link_data)(void *cls, + const struct TALER_CoinSpendPublicKeyP *coin_pub, + TALER_EXCHANGEDB_LinkCallback ldc, + void *tdc_cls); /** @@ -4652,7 +4684,7 @@ struct TALER_EXCHANGEDB_Plugin * @return database transaction status */ enum GNUNET_DB_QueryStatus - (*get_coin_transactions)( + (*get_coin_transactions)( void *cls, const struct TALER_CoinSpendPublicKeyP *coin_pub, uint64_t start_off, @@ -4685,10 +4717,10 @@ struct TALER_EXCHANGEDB_Plugin * @return query status of the transaction */ enum GNUNET_DB_QueryStatus - (*lookup_wire_transfer)(void *cls, - const struct TALER_WireTransferIdentifierRawP *wtid, - TALER_EXCHANGEDB_AggregationDataCallback cb, - void *cb_cls); + (*lookup_wire_transfer)(void *cls, + const struct TALER_WireTransferIdentifierRawP *wtid, + TALER_EXCHANGEDB_AggregationDataCallback cb, + void *cb_cls); /** @@ -4713,7 +4745,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*lookup_transfer_by_deposit)( + (*lookup_transfer_by_deposit)( void *cls, const struct TALER_PrivateContractHashP *h_contract_terms, const struct TALER_MerchantWireHashP *h_wire, @@ -4740,12 +4772,12 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*insert_wire_fee)(void *cls, - const char *wire_method, - struct GNUNET_TIME_Timestamp start_date, - struct GNUNET_TIME_Timestamp end_date, - const struct TALER_WireFeeSet *fees, - const struct TALER_MasterSignatureP *master_sig); + (*insert_wire_fee)(void *cls, + const char *wire_method, + struct GNUNET_TIME_Timestamp start_date, + struct GNUNET_TIME_Timestamp end_date, + const struct TALER_WireFeeSet *fees, + const struct TALER_MasterSignatureP *master_sig); /** @@ -4762,15 +4794,15 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*insert_global_fee)(void *cls, - struct GNUNET_TIME_Timestamp start_date, - struct GNUNET_TIME_Timestamp end_date, - const struct TALER_GlobalFeeSet *fees, - struct GNUNET_TIME_Relative purse_timeout, - struct GNUNET_TIME_Relative history_expiration, - uint32_t purse_account_limit, + (*insert_global_fee)(void *cls, + struct GNUNET_TIME_Timestamp start_date, + struct GNUNET_TIME_Timestamp end_date, + const struct TALER_GlobalFeeSet *fees, + struct GNUNET_TIME_Relative purse_timeout, + struct GNUNET_TIME_Relative history_expiration, + uint32_t purse_account_limit, - const struct TALER_MasterSignatureP *master_sig); + const struct TALER_MasterSignatureP *master_sig); /** @@ -4786,13 +4818,13 @@ struct TALER_EXCHANGEDB_Plugin * @return query status of the transaction */ enum GNUNET_DB_QueryStatus - (*get_wire_fee)(void *cls, - const char *type, - struct GNUNET_TIME_Timestamp date, - struct GNUNET_TIME_Timestamp *start_date, - struct GNUNET_TIME_Timestamp *end_date, - struct TALER_WireFeeSet *fees, - struct TALER_MasterSignatureP *master_sig); + (*get_wire_fee)(void *cls, + const char *type, + struct GNUNET_TIME_Timestamp date, + struct GNUNET_TIME_Timestamp *start_date, + struct GNUNET_TIME_Timestamp *end_date, + struct TALER_WireFeeSet *fees, + struct TALER_MasterSignatureP *master_sig); /** @@ -4810,15 +4842,15 @@ struct TALER_EXCHANGEDB_Plugin * @return query status of the transaction */ enum GNUNET_DB_QueryStatus - (*get_global_fee)(void *cls, - struct GNUNET_TIME_Timestamp date, - struct GNUNET_TIME_Timestamp *start_date, - struct GNUNET_TIME_Timestamp *end_date, - struct TALER_GlobalFeeSet *fees, - struct GNUNET_TIME_Relative *purse_timeout, - struct GNUNET_TIME_Relative *history_expiration, - uint32_t *purse_account_limit, - struct TALER_MasterSignatureP *master_sig); + (*get_global_fee)(void *cls, + struct GNUNET_TIME_Timestamp date, + struct GNUNET_TIME_Timestamp *start_date, + struct GNUNET_TIME_Timestamp *end_date, + struct TALER_GlobalFeeSet *fees, + struct GNUNET_TIME_Relative *purse_timeout, + struct GNUNET_TIME_Relative *history_expiration, + uint32_t *purse_account_limit, + struct TALER_MasterSignatureP *master_sig); /** @@ -4832,10 +4864,10 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status */ enum GNUNET_DB_QueryStatus - (*get_expired_reserves)(void *cls, - struct GNUNET_TIME_Timestamp now, - TALER_EXCHANGEDB_ReserveExpiredCallback rec, - void *rec_cls); + (*get_expired_reserves)(void *cls, + struct GNUNET_TIME_Timestamp now, + TALER_EXCHANGEDB_ReserveExpiredCallback rec, + void *rec_cls); /** @@ -4850,7 +4882,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status */ enum GNUNET_DB_QueryStatus - (*get_unfinished_close_requests)( + (*get_unfinished_close_requests)( void *cls, TALER_EXCHANGEDB_ReserveExpiredCallback rec, void *rec_cls); @@ -4871,7 +4903,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code, 0 if operation is already in the DB */ enum GNUNET_DB_QueryStatus - (*insert_reserve_open_deposit)( + (*insert_reserve_open_deposit)( void *cls, const struct TALER_CoinPublicInfo *cpi, const struct TALER_CoinSpendSignatureP *coin_sig, @@ -4901,19 +4933,19 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*do_reserve_open)(void *cls, - const struct TALER_ReservePublicKeyP *reserve_pub, - const struct TALER_Amount *total_paid, - const struct TALER_Amount *reserve_payment, - uint32_t min_purse_limit, - const struct TALER_ReserveSignatureP *reserve_sig, - struct GNUNET_TIME_Timestamp desired_expiration, - struct GNUNET_TIME_Timestamp now, - const struct TALER_Amount *open_fee, - bool *no_funds, - struct TALER_Amount *reserve_balance, - struct TALER_Amount *open_cost, - struct GNUNET_TIME_Timestamp *final_expiration); + (*do_reserve_open)(void *cls, + const struct TALER_ReservePublicKeyP *reserve_pub, + const struct TALER_Amount *total_paid, + const struct TALER_Amount *reserve_payment, + uint32_t min_purse_limit, + const struct TALER_ReserveSignatureP *reserve_sig, + struct GNUNET_TIME_Timestamp desired_expiration, + struct GNUNET_TIME_Timestamp now, + const struct TALER_Amount *open_fee, + bool *no_funds, + struct TALER_Amount *reserve_balance, + struct TALER_Amount *open_cost, + struct GNUNET_TIME_Timestamp *final_expiration); /** @@ -4929,7 +4961,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code, 0 if reserve unknown */ enum GNUNET_DB_QueryStatus - (*select_reserve_close_info)( + (*select_reserve_close_info)( void *cls, const struct TALER_ReservePublicKeyP *reserve_pub, struct TALER_Amount *balance, @@ -4952,7 +4984,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code, 0 if reserve unknown */ enum GNUNET_DB_QueryStatus - (*select_reserve_close_request_info)( + (*select_reserve_close_request_info)( void *cls, const struct TALER_ReservePublicKeyP *reserve_pub, uint64_t rowid, @@ -4976,7 +5008,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code, @a kac aborting with #GNUNET_NO is not an error */ enum GNUNET_DB_QueryStatus - (*iterate_reserve_close_info)( + (*iterate_reserve_close_info)( void *cls, const struct TALER_PaytoHashP *h_payto, struct GNUNET_TIME_Absolute time_limit, @@ -4998,14 +5030,15 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*insert_reserve_closed)(void *cls, - const struct TALER_ReservePublicKeyP *reserve_pub, - struct GNUNET_TIME_Timestamp execution_date, - const char *receiver_account, - const struct TALER_WireTransferIdentifierRawP *wtid, - const struct TALER_Amount *amount_with_fee, - const struct TALER_Amount *closing_fee, - uint64_t close_request_row); + (*insert_reserve_closed)(void *cls, + const struct TALER_ReservePublicKeyP *reserve_pub, + struct GNUNET_TIME_Timestamp execution_date, + const char *receiver_account, + const struct + TALER_WireTransferIdentifierRawP *wtid, + const struct TALER_Amount *amount_with_fee, + const struct TALER_Amount *closing_fee, + uint64_t close_request_row); /** @@ -5018,10 +5051,10 @@ struct TALER_EXCHANGEDB_Plugin * @return query status code */ enum GNUNET_DB_QueryStatus - (*wire_prepare_data_insert)(void *cls, - const char *type, - const char *buf, - size_t buf_size); + (*wire_prepare_data_insert)(void *cls, + const char *type, + const char *buf, + size_t buf_size); /** @@ -5032,8 +5065,8 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*wire_prepare_data_mark_finished)(void *cls, - uint64_t rowid); + (*wire_prepare_data_mark_finished)(void *cls, + uint64_t rowid); /** @@ -5044,8 +5077,8 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*wire_prepare_data_mark_failed)(void *cls, - uint64_t rowid); + (*wire_prepare_data_mark_failed)(void *cls, + uint64_t rowid); /** @@ -5060,11 +5093,11 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*wire_prepare_data_get)(void *cls, - uint64_t start_row, - uint64_t limit, - TALER_EXCHANGEDB_WirePreparationIterator cb, - void *cb_cls); + (*wire_prepare_data_get)(void *cls, + uint64_t start_row, + uint64_t limit, + TALER_EXCHANGEDB_WirePreparationIterator cb, + void *cb_cls); /** @@ -5076,7 +5109,7 @@ struct TALER_EXCHANGEDB_Plugin * @return #GNUNET_OK on success */ enum GNUNET_GenericReturnValue - (*start_deferred_wire_out)(void *cls); + (*start_deferred_wire_out)(void *cls); /** @@ -5093,7 +5126,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*store_wire_transfer_out)( + (*store_wire_transfer_out)( void *cls, struct GNUNET_TIME_Timestamp date, const struct TALER_WireTransferIdentifierRawP *wtid, @@ -5111,7 +5144,7 @@ struct TALER_EXCHANGEDB_Plugin * #GNUNET_SYSERR on DB errors */ enum GNUNET_GenericReturnValue - (*gc)(void *cls); + (*gc)(void *cls); /** @@ -5125,10 +5158,10 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*select_coin_deposits_above_serial_id)(void *cls, - uint64_t serial_id, - TALER_EXCHANGEDB_DepositCallback cb, - void *cb_cls); + (*select_coin_deposits_above_serial_id)(void *cls, + uint64_t serial_id, + TALER_EXCHANGEDB_DepositCallback cb, + void *cb_cls); /** @@ -5142,7 +5175,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*select_purse_requests_above_serial_id)( + (*select_purse_requests_above_serial_id)( void *cls, uint64_t serial_id, TALER_EXCHANGEDB_PurseRequestCallback cb, @@ -5160,7 +5193,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*select_purse_deposits_above_serial_id)( + (*select_purse_deposits_above_serial_id)( void *cls, uint64_t serial_id, TALER_EXCHANGEDB_PurseDepositCallback cb, @@ -5178,7 +5211,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*select_account_merges_above_serial_id)( + (*select_account_merges_above_serial_id)( void *cls, uint64_t serial_id, TALER_EXCHANGEDB_AccountMergeCallback cb, @@ -5196,7 +5229,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*select_purse_merges_above_serial_id)( + (*select_purse_merges_above_serial_id)( void *cls, uint64_t serial_id, TALER_EXCHANGEDB_PurseMergeCallback cb, @@ -5215,7 +5248,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*select_purse_decisions_above_serial_id)( + (*select_purse_decisions_above_serial_id)( void *cls, uint64_t serial_id, bool refunded, @@ -5234,7 +5267,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*select_all_purse_decisions_above_serial_id)( + (*select_all_purse_decisions_above_serial_id)( void *cls, uint64_t serial_id, TALER_EXCHANGEDB_AllPurseDecisionCallback cb, @@ -5251,7 +5284,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*select_purse_deposits_by_purse)( + (*select_purse_deposits_by_purse)( void *cls, const struct TALER_PurseContractPublicKeyP *purse_pub, TALER_EXCHANGEDB_PurseRefundCoinCallback cb, @@ -5269,10 +5302,10 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*select_refreshes_above_serial_id)(void *cls, - uint64_t serial_id, - TALER_EXCHANGEDB_RefreshesCallback cb, - void *cb_cls); + (*select_refreshes_above_serial_id)(void *cls, + uint64_t serial_id, + TALER_EXCHANGEDB_RefreshesCallback cb, + void *cb_cls); /** @@ -5286,10 +5319,10 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*select_refunds_above_serial_id)(void *cls, - uint64_t serial_id, - TALER_EXCHANGEDB_RefundCallback cb, - void *cb_cls); + (*select_refunds_above_serial_id)(void *cls, + uint64_t serial_id, + TALER_EXCHANGEDB_RefundCallback cb, + void *cb_cls); /** @@ -5303,10 +5336,10 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*select_reserves_in_above_serial_id)(void *cls, - uint64_t serial_id, - TALER_EXCHANGEDB_ReserveInCallback cb, - void *cb_cls); + (*select_reserves_in_above_serial_id)(void *cls, + uint64_t serial_id, + TALER_EXCHANGEDB_ReserveInCallback cb, + void *cb_cls); /** @@ -5321,7 +5354,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*select_reserves_in_above_serial_id_by_account)( + (*select_reserves_in_above_serial_id_by_account)( void *cls, const char *account_name, uint64_t serial_id, @@ -5341,7 +5374,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*select_withdrawals_above_serial_id)( + (*select_withdrawals_above_serial_id)( void *cls, uint64_t serial_id, TALER_EXCHANGEDB_WithdrawCallback cb, @@ -5359,10 +5392,11 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*select_wire_out_above_serial_id)(void *cls, - uint64_t serial_id, - TALER_EXCHANGEDB_WireTransferOutCallback cb, - void *cb_cls); + (*select_wire_out_above_serial_id)(void *cls, + uint64_t serial_id, + TALER_EXCHANGEDB_WireTransferOutCallback + cb, + void *cb_cls); /** * Function called to select outgoing wire transfers the exchange @@ -5376,7 +5410,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*select_wire_out_above_serial_id_by_account)( + (*select_wire_out_above_serial_id_by_account)( void *cls, const char *account_name, uint64_t serial_id, @@ -5395,10 +5429,10 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*select_recoup_above_serial_id)(void *cls, - uint64_t serial_id, - TALER_EXCHANGEDB_RecoupCallback cb, - void *cb_cls); + (*select_recoup_above_serial_id)(void *cls, + uint64_t serial_id, + TALER_EXCHANGEDB_RecoupCallback cb, + void *cb_cls); /** @@ -5412,7 +5446,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*select_recoup_refresh_above_serial_id)( + (*select_recoup_refresh_above_serial_id)( void *cls, uint64_t serial_id, TALER_EXCHANGEDB_RecoupRefreshCallback cb, @@ -5430,7 +5464,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*select_reserve_open_above_serial_id)( + (*select_reserve_open_above_serial_id)( void *cls, uint64_t serial_id, TALER_EXCHANGEDB_ReserveOpenCallback cb, @@ -5448,7 +5482,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*select_reserve_closed_above_serial_id)( + (*select_reserve_closed_above_serial_id)( void *cls, uint64_t serial_id, TALER_EXCHANGEDB_ReserveClosedCallback cb, @@ -5466,7 +5500,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*get_reserve_by_h_blind)( + (*get_reserve_by_h_blind)( void *cls, const struct TALER_BlindedCoinHashP *bch, struct TALER_ReservePublicKeyP *reserve_pub, @@ -5484,7 +5518,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*get_old_coin_by_h_blind)( + (*get_old_coin_by_h_blind)( void *cls, const struct TALER_BlindedCoinHashP *h_blind_ev, struct TALER_CoinSpendPublicKeyP *old_coin_pub, @@ -5501,7 +5535,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*insert_denomination_revocation)( + (*insert_denomination_revocation)( void *cls, const struct TALER_DenominationHashP *denom_pub_hash, const struct TALER_MasterSignatureP *master_sig); @@ -5518,7 +5552,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*get_denomination_revocation)( + (*get_denomination_revocation)( void *cls, const struct TALER_DenominationHashP *denom_pub_hash, struct TALER_MasterSignatureP *master_sig, @@ -5536,7 +5570,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*select_batch_deposits_missing_wire)( + (*select_batch_deposits_missing_wire)( void *cls, uint64_t min_batch_deposit_serial_id, TALER_EXCHANGEDB_WireMissingCallback cb, @@ -5554,7 +5588,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*select_aggregations_above_serial)( + (*select_aggregations_above_serial)( void *cls, uint64_t min_tracking_serial_id, TALER_EXCHANGEDB_AggregationCallback cb, @@ -5576,7 +5610,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*select_justification_for_missing_wire)( + (*select_justification_for_missing_wire)( void *cls, const struct TALER_PaytoHashP *wire_target_h_payto, char **payto_uri, @@ -5594,7 +5628,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*lookup_auditor_timestamp)( + (*lookup_auditor_timestamp)( void *cls, const struct TALER_AuditorPublicKeyP *auditor_pub, struct GNUNET_TIME_Timestamp *last_date); @@ -5611,7 +5645,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*lookup_auditor_status)( + (*lookup_auditor_status)( void *cls, const struct TALER_AuditorPublicKeyP *auditor_pub, char **auditor_url, @@ -5630,7 +5664,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*insert_auditor)( + (*insert_auditor)( void *cls, const struct TALER_AuditorPublicKeyP *auditor_pub, const char *auditor_url, @@ -5651,7 +5685,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*update_auditor)( + (*update_auditor)( void *cls, const struct TALER_AuditorPublicKeyP *auditor_pub, const char *auditor_url, @@ -5669,9 +5703,9 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*lookup_wire_timestamp)(void *cls, - const char *payto_uri, - struct GNUNET_TIME_Timestamp *last_date); + (*lookup_wire_timestamp)(void *cls, + const char *payto_uri, + struct GNUNET_TIME_Timestamp *last_date); /** @@ -5689,13 +5723,13 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*insert_wire)(void *cls, - const char *payto_uri, - const char *conversion_url, - const json_t *debit_restrictions, - const json_t *credit_restrictions, - struct GNUNET_TIME_Timestamp start_date, - const struct TALER_MasterSignatureP *master_sig); + (*insert_wire)(void *cls, + const char *payto_uri, + const char *conversion_url, + const json_t *debit_restrictions, + const json_t *credit_restrictions, + struct GNUNET_TIME_Timestamp start_date, + const struct TALER_MasterSignatureP *master_sig); /** @@ -5712,13 +5746,13 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*update_wire)(void *cls, - const char *payto_uri, - const char *conversion_url, - const json_t *debit_restrictions, - const json_t *credit_restrictions, - struct GNUNET_TIME_Timestamp change_date, - bool enabled); + (*update_wire)(void *cls, + const char *payto_uri, + const char *conversion_url, + const json_t *debit_restrictions, + const json_t *credit_restrictions, + struct GNUNET_TIME_Timestamp change_date, + bool enabled); /** @@ -5730,9 +5764,9 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*get_wire_accounts)(void *cls, - TALER_EXCHANGEDB_WireAccountCallback cb, - void *cb_cls); + (*get_wire_accounts)(void *cls, + TALER_EXCHANGEDB_WireAccountCallback cb, + void *cb_cls); /** @@ -5746,10 +5780,10 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*get_wire_fees)(void *cls, - const char *wire_method, - TALER_EXCHANGEDB_WireFeeCallback cb, - void *cb_cls); + (*get_wire_fees)(void *cls, + const char *wire_method, + TALER_EXCHANGEDB_WireFeeCallback cb, + void *cb_cls); /** @@ -5761,9 +5795,9 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*get_global_fees)(void *cls, - TALER_EXCHANGEDB_GlobalFeeCallback cb, - void *cb_cls); + (*get_global_fees)(void *cls, + TALER_EXCHANGEDB_GlobalFeeCallback cb, + void *cb_cls); /** @@ -5775,7 +5809,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*insert_signkey_revocation)( + (*insert_signkey_revocation)( void *cls, const struct TALER_ExchangePublicKeyP *exchange_pub, const struct TALER_MasterSignatureP *master_sig); @@ -5790,7 +5824,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*lookup_signkey_revocation)( + (*lookup_signkey_revocation)( void *cls, const struct TALER_ExchangePublicKeyP *exchange_pub, struct TALER_MasterSignatureP *master_sig); @@ -5805,7 +5839,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*lookup_denomination_key)( + (*lookup_denomination_key)( void *cls, const struct TALER_DenominationHashP *h_denom_pub, struct TALER_EXCHANGEDB_DenominationKeyMetaData *meta); @@ -5822,7 +5856,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*add_denomination_key)( + (*add_denomination_key)( void *cls, const struct TALER_DenominationHashP *h_denom_pub, const struct TALER_DenominationPublicKey *denom_pub, @@ -5841,7 +5875,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*activate_signing_key)( + (*activate_signing_key)( void *cls, const struct TALER_ExchangePublicKeyP *exchange_pub, const struct TALER_EXCHANGEDB_SignkeyMetaData *meta, @@ -5857,7 +5891,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*lookup_signing_key)( + (*lookup_signing_key)( void *cls, const struct TALER_ExchangePublicKeyP *exchange_pub, struct TALER_EXCHANGEDB_SignkeyMetaData *meta); @@ -5873,7 +5907,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*insert_auditor_denom_sig)( + (*insert_auditor_denom_sig)( void *cls, const struct TALER_DenominationHashP *h_denom_pub, const struct TALER_AuditorPublicKeyP *auditor_pub, @@ -5890,7 +5924,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*select_auditor_denom_sig)( + (*select_auditor_denom_sig)( void *cls, const struct TALER_DenominationHashP *h_denom_pub, const struct TALER_AuditorPublicKeyP *auditor_pub, @@ -5910,7 +5944,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*lookup_wire_fee_by_time)( + (*lookup_wire_fee_by_time)( void *cls, const char *wire_method, struct GNUNET_TIME_Timestamp start_time, @@ -5933,7 +5967,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*lookup_global_fee_by_time)( + (*lookup_global_fee_by_time)( void *cls, struct GNUNET_TIME_Timestamp start_time, struct GNUNET_TIME_Timestamp end_time, @@ -5954,9 +5988,9 @@ struct TALER_EXCHANGEDB_Plugin * @a table does not have a serial number */ enum GNUNET_DB_QueryStatus - (*lookup_serial_by_table)(void *cls, - enum TALER_EXCHANGEDB_ReplicatedTable table, - uint64_t *serial); + (*lookup_serial_by_table)(void *cls, + enum TALER_EXCHANGEDB_ReplicatedTable table, + uint64_t *serial); /** * Lookup records above @a serial number in @a table. Used in @@ -5971,11 +6005,11 @@ struct TALER_EXCHANGEDB_Plugin * @a table does not have a serial number */ enum GNUNET_DB_QueryStatus - (*lookup_records_by_table)(void *cls, - enum TALER_EXCHANGEDB_ReplicatedTable table, - uint64_t serial, - TALER_EXCHANGEDB_ReplicationCallback cb, - void *cb_cls); + (*lookup_records_by_table)(void *cls, + enum TALER_EXCHANGEDB_ReplicatedTable table, + uint64_t serial, + TALER_EXCHANGEDB_ReplicationCallback cb, + void *cb_cls); /** @@ -5989,8 +6023,8 @@ struct TALER_EXCHANGEDB_Plugin * @a table does not have a serial number */ enum GNUNET_DB_QueryStatus - (*insert_records_by_table)(void *cls, - const struct TALER_EXCHANGEDB_TableData *td); + (*insert_records_by_table)(void *cls, + const struct TALER_EXCHANGEDB_TableData *td); /** @@ -6006,12 +6040,12 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*begin_shard)(void *cls, - const char *job_name, - struct GNUNET_TIME_Relative delay, - uint64_t shard_size, - uint64_t *start_row, - uint64_t *end_row); + (*begin_shard)(void *cls, + const char *job_name, + struct GNUNET_TIME_Relative delay, + uint64_t shard_size, + uint64_t *start_row, + uint64_t *end_row); /** * Function called to abort work on a shard. @@ -6023,10 +6057,10 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*abort_shard)(void *cls, - const char *job_name, - uint64_t start_row, - uint64_t end_row); + (*abort_shard)(void *cls, + const char *job_name, + uint64_t start_row, + uint64_t end_row); /** * Function called to persist that work on a shard was completed. @@ -6038,10 +6072,10 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*complete_shard)(void *cls, - const char *job_name, - uint64_t start_row, - uint64_t end_row); + (*complete_shard)(void *cls, + const char *job_name, + uint64_t start_row, + uint64_t end_row); /** @@ -6057,12 +6091,12 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*begin_revolving_shard)(void *cls, - const char *job_name, - uint32_t shard_size, - uint32_t shard_limit, - uint32_t *start_row, - uint32_t *end_row); + (*begin_revolving_shard)(void *cls, + const char *job_name, + uint32_t shard_size, + uint32_t shard_limit, + uint32_t *start_row, + uint32_t *end_row); /** @@ -6076,10 +6110,10 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*release_revolving_shard)(void *cls, - const char *job_name, - uint32_t start_row, - uint32_t end_row); + (*release_revolving_shard)(void *cls, + const char *job_name, + uint32_t start_row, + uint32_t end_row); /** @@ -6092,7 +6126,7 @@ struct TALER_EXCHANGEDB_Plugin * #GNUNET_SYSERR on failure */ enum GNUNET_GenericReturnValue - (*delete_shard_locks)(void *cls); + (*delete_shard_locks)(void *cls); /** @@ -6105,9 +6139,9 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*set_extension_manifest)(void *cls, - const char *extension_name, - const char *manifest); + (*set_extension_manifest)(void *cls, + const char *extension_name, + const char *manifest); /** @@ -6120,9 +6154,9 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*get_extension_manifest)(void *cls, - const char *extension_name, - char **manifest); + (*get_extension_manifest)(void *cls, + const char *extension_name, + char **manifest); /** @@ -6140,14 +6174,14 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*insert_partner)(void *cls, - const struct TALER_MasterPublicKeyP *master_pub, - struct GNUNET_TIME_Timestamp start_date, - struct GNUNET_TIME_Timestamp end_date, - struct GNUNET_TIME_Relative wad_frequency, - const struct TALER_Amount *wad_fee, - const char *partner_base_url, - const struct TALER_MasterSignatureP *master_sig); + (*insert_partner)(void *cls, + const struct TALER_MasterPublicKeyP *master_pub, + struct GNUNET_TIME_Timestamp start_date, + struct GNUNET_TIME_Timestamp end_date, + struct GNUNET_TIME_Relative wad_frequency, + const struct TALER_Amount *wad_fee, + const char *partner_base_url, + const struct TALER_MasterSignatureP *master_sig); /** @@ -6163,10 +6197,10 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*insert_contract)(void *cls, - const struct TALER_PurseContractPublicKeyP *purse_pub, - const struct TALER_EncryptedContract *econtract, - bool *in_conflict); + (*insert_contract)(void *cls, + const struct TALER_PurseContractPublicKeyP *purse_pub, + const struct TALER_EncryptedContract *econtract, + bool *in_conflict); /** @@ -6181,7 +6215,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*select_contract)( + (*select_contract)( void *cls, const struct TALER_ContractDiffiePublicP *pub_ckey, struct TALER_PurseContractPublicKeyP *purse_pub, @@ -6199,7 +6233,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*select_contract_by_purse)( + (*select_contract_by_purse)( void *cls, const struct TALER_PurseContractPublicKeyP *purse_pub, struct TALER_EncryptedContract *econtract); @@ -6225,7 +6259,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*insert_purse_request)( + (*insert_purse_request)( void *cls, const struct TALER_PurseContractPublicKeyP *purse_pub, const struct TALER_PurseMergePublicKeyP *merge_pub, @@ -6248,7 +6282,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code (#GNUNET_DB_STATUS_SUCCESS_NO_RESULTS if no purse expired in the given time interval). */ enum GNUNET_DB_QueryStatus - (*expire_purse)( + (*expire_purse)( void *cls, struct GNUNET_TIME_Absolute start_time, struct GNUNET_TIME_Absolute end_time); @@ -6269,7 +6303,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*select_purse)( + (*select_purse)( void *cls, const struct TALER_PurseContractPublicKeyP *purse_pub, struct GNUNET_TIME_Timestamp *purse_creation, @@ -6297,7 +6331,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*get_purse_request)( + (*get_purse_request)( void *cls, const struct TALER_PurseContractPublicKeyP *purse_pub, struct TALER_PurseMergePublicKeyP *merge_pub, @@ -6325,7 +6359,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*select_purse_by_merge_pub)( + (*select_purse_by_merge_pub)( void *cls, const struct TALER_PurseMergePublicKeyP *merge_pub, struct TALER_PurseContractPublicKeyP *purse_pub, @@ -6361,7 +6395,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*do_purse_deposit)( + (*do_purse_deposit)( void *cls, const struct TALER_PurseContractPublicKeyP *purse_pub, const struct TALER_CoinSpendPublicKeyP *coin_pub, @@ -6386,7 +6420,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*do_purse_delete)( + (*do_purse_delete)( void *cls, const struct TALER_PurseContractPublicKeyP *purse_pub, const struct TALER_PurseContractSignatureP *purse_sig, @@ -6405,7 +6439,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status */ enum GNUNET_DB_QueryStatus - (*set_purse_balance)( + (*set_purse_balance)( void *cls, const struct TALER_PurseContractPublicKeyP *purse_pub, const struct TALER_Amount *balance); @@ -6426,7 +6460,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*get_purse_deposit)( + (*get_purse_deposit)( void *cls, const struct TALER_PurseContractPublicKeyP *purse_pub, const struct TALER_CoinSpendPublicKeyP *coin_pub, @@ -6456,7 +6490,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*do_purse_merge)( + (*do_purse_merge)( void *cls, const struct TALER_PurseContractPublicKeyP *purse_pub, const struct TALER_PurseMergeSignatureP *merge_sig, @@ -6487,7 +6521,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*do_reserve_purse)( + (*do_reserve_purse)( void *cls, const struct TALER_PurseContractPublicKeyP *purse_pub, const struct TALER_PurseMergeSignatureP *merge_sig, @@ -6513,7 +6547,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*select_purse_merge)( + (*select_purse_merge)( void *cls, const struct TALER_PurseContractPublicKeyP *purse_pub, struct TALER_PurseMergeSignatureP *merge_sig, @@ -6535,13 +6569,13 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*insert_close_request)(void *cls, - const struct TALER_ReservePublicKeyP *reserve_pub, - const char *payto_uri, - const struct TALER_ReserveSignatureP *reserve_sig, - struct GNUNET_TIME_Timestamp request_timestamp, - const struct TALER_Amount *balance, - const struct TALER_Amount *closing_fee); + (*insert_close_request)(void *cls, + const struct TALER_ReservePublicKeyP *reserve_pub, + const char *payto_uri, + const struct TALER_ReserveSignatureP *reserve_sig, + struct GNUNET_TIME_Timestamp request_timestamp, + const struct TALER_Amount *balance, + const struct TALER_Amount *closing_fee); /** @@ -6557,13 +6591,13 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*insert_drain_profit)(void *cls, - const struct TALER_WireTransferIdentifierRawP *wtid, - const char *account_section, - const char *payto_uri, - struct GNUNET_TIME_Timestamp request_timestamp, - const struct TALER_Amount *amount, - const struct TALER_MasterSignatureP *master_sig); + (*insert_drain_profit)(void *cls, + const struct TALER_WireTransferIdentifierRawP *wtid, + const char *account_section, + const char *payto_uri, + struct GNUNET_TIME_Timestamp request_timestamp, + const struct TALER_Amount *amount, + const struct TALER_MasterSignatureP *master_sig); /** @@ -6580,14 +6614,14 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*get_drain_profit)(void *cls, - const struct TALER_WireTransferIdentifierRawP *wtid, - uint64_t *serial, - char **account_section, - char **payto_uri, - struct GNUNET_TIME_Timestamp *request_timestamp, - struct TALER_Amount *amount, - struct TALER_MasterSignatureP *master_sig); + (*get_drain_profit)(void *cls, + const struct TALER_WireTransferIdentifierRawP *wtid, + uint64_t *serial, + char **account_section, + char **payto_uri, + struct GNUNET_TIME_Timestamp *request_timestamp, + struct TALER_Amount *amount, + struct TALER_MasterSignatureP *master_sig); /** @@ -6604,7 +6638,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*profit_drains_get_pending)( + (*profit_drains_get_pending)( void *cls, uint64_t *serial, struct TALER_WireTransferIdentifierRawP *wtid, @@ -6623,7 +6657,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*profit_drains_set_finished)( + (*profit_drains_set_finished)( void *cls, uint64_t serial); @@ -6639,7 +6673,7 @@ struct TALER_EXCHANGEDB_Plugin * @return database transaction status */ enum GNUNET_DB_QueryStatus - (*insert_kyc_requirement_for_account)( + (*insert_kyc_requirement_for_account)( void *cls, const char *requirements, const struct TALER_PaytoHashP *h_payto, @@ -6659,7 +6693,7 @@ struct TALER_EXCHANGEDB_Plugin * @return database transaction status */ enum GNUNET_DB_QueryStatus - (*insert_kyc_requirement_process)( + (*insert_kyc_requirement_process)( void *cls, const struct TALER_PaytoHashP *h_payto, const char *provider_section, @@ -6678,7 +6712,7 @@ struct TALER_EXCHANGEDB_Plugin * @return database transaction status */ enum GNUNET_DB_QueryStatus - (*get_pending_kyc_requirement_process)( + (*get_pending_kyc_requirement_process)( void *cls, const struct TALER_PaytoHashP *h_payto, const char *provider_section, @@ -6700,7 +6734,7 @@ struct TALER_EXCHANGEDB_Plugin * @return database transaction status */ enum GNUNET_DB_QueryStatus - (*update_kyc_process_by_row)( + (*update_kyc_process_by_row)( void *cls, uint64_t process_row, const char *provider_section, @@ -6722,7 +6756,7 @@ struct TALER_EXCHANGEDB_Plugin * @return database transaction status */ enum GNUNET_DB_QueryStatus - (*lookup_kyc_requirement_by_row)( + (*lookup_kyc_requirement_by_row)( void *cls, uint64_t requirement_row, char **requirements, @@ -6743,7 +6777,7 @@ struct TALER_EXCHANGEDB_Plugin * @return database transaction status */ enum GNUNET_DB_QueryStatus - (*lookup_kyc_process_by_account)( + (*lookup_kyc_process_by_account)( void *cls, const char *provider_section, const struct TALER_PaytoHashP *h_payto, @@ -6765,7 +6799,7 @@ struct TALER_EXCHANGEDB_Plugin * @return database transaction status */ enum GNUNET_DB_QueryStatus - (*kyc_provider_account_lookup)( + (*kyc_provider_account_lookup)( void *cls, const char *provider_section, const char *provider_legitimization_id, @@ -6784,7 +6818,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*select_satisfied_kyc_processes)( + (*select_satisfied_kyc_processes)( void *cls, const struct TALER_PaytoHashP *h_payto, TALER_EXCHANGEDB_SatisfiedProviderCallback spc, @@ -6802,7 +6836,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*iterate_kyc_reference)( + (*iterate_kyc_reference)( void *cls, const struct TALER_PaytoHashP *h_payto, TALER_EXCHANGEDB_LegitimizationProcessCallback lpc, @@ -6821,7 +6855,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code, @a kac aborting with #GNUNET_NO is not an error */ enum GNUNET_DB_QueryStatus - (*select_withdraw_amounts_for_kyc_check)( + (*select_withdraw_amounts_for_kyc_check)( void *cls, const struct TALER_PaytoHashP *h_payto, struct GNUNET_TIME_Absolute time_limit, @@ -6841,7 +6875,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code, @a kac aborting with #GNUNET_NO is not an error */ enum GNUNET_DB_QueryStatus - (*select_aggregation_amounts_for_kyc_check)( + (*select_aggregation_amounts_for_kyc_check)( void *cls, const struct TALER_PaytoHashP *h_payto, struct GNUNET_TIME_Absolute time_limit, @@ -6861,7 +6895,7 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code, @a kac aborting with #GNUNET_NO is not an error */ enum GNUNET_DB_QueryStatus - (*select_merge_amounts_for_kyc_check)( + (*select_merge_amounts_for_kyc_check)( void *cls, const struct TALER_PaytoHashP *h_payto, struct GNUNET_TIME_Absolute time_limit, @@ -6891,7 +6925,7 @@ struct TALER_EXCHANGEDB_Plugin * @return database transaction status */ enum GNUNET_DB_QueryStatus - (*insert_kyc_attributes)( + (*insert_kyc_attributes)( void *cls, uint64_t process_row, const struct TALER_PaytoHashP *h_payto, @@ -6919,7 +6953,7 @@ struct TALER_EXCHANGEDB_Plugin * @return database transaction status */ enum GNUNET_DB_QueryStatus - (*select_similar_kyc_attributes)( + (*select_similar_kyc_attributes)( void *cls, const struct GNUNET_ShortHashCode *kyc_prox, TALER_EXCHANGEDB_AttributeCallback cb, @@ -6936,7 +6970,7 @@ struct TALER_EXCHANGEDB_Plugin * @return database transaction status */ enum GNUNET_DB_QueryStatus - (*select_kyc_attributes)( + (*select_kyc_attributes)( void *cls, const struct TALER_PaytoHashP *h_payto, TALER_EXCHANGEDB_AttributeCallback cb, @@ -6957,7 +6991,7 @@ struct TALER_EXCHANGEDB_Plugin * @return database transaction status */ enum GNUNET_DB_QueryStatus - (*insert_aml_officer)( + (*insert_aml_officer)( void *cls, const struct TALER_AmlOfficerPublicKeyP *decider_pub, const struct TALER_MasterSignatureP *master_sig, @@ -6977,7 +7011,7 @@ struct TALER_EXCHANGEDB_Plugin * @return database transaction status, if member is unknown or not active, 1 if member is active */ enum GNUNET_DB_QueryStatus - (*test_aml_officer)( + (*test_aml_officer)( void *cls, const struct TALER_AmlOfficerPublicKeyP *decider_pub); @@ -6995,7 +7029,7 @@ struct TALER_EXCHANGEDB_Plugin * @return database transaction status */ enum GNUNET_DB_QueryStatus - (*lookup_aml_officer)( + (*lookup_aml_officer)( void *cls, const struct TALER_AmlOfficerPublicKeyP *decider_pub, struct TALER_MasterSignatureP *master_sig, @@ -7015,7 +7049,7 @@ struct TALER_EXCHANGEDB_Plugin * @return database transaction status, 0 if no threshold was set */ enum GNUNET_DB_QueryStatus - (*select_aml_threshold)( + (*select_aml_threshold)( void *cls, const struct TALER_PaytoHashP *h_payto, enum TALER_AmlDecisionState *decision, @@ -7033,7 +7067,7 @@ struct TALER_EXCHANGEDB_Plugin * @return database transaction status */ enum GNUNET_DB_QueryStatus - (*trigger_aml_process)( + (*trigger_aml_process)( void *cls, const struct TALER_PaytoHashP *h_payto, const struct TALER_Amount *threshold_crossed); @@ -7051,7 +7085,7 @@ struct TALER_EXCHANGEDB_Plugin * @return database transaction status */ enum GNUNET_DB_QueryStatus - (*select_aml_process)( + (*select_aml_process)( void *cls, enum TALER_AmlDecisionState decision, uint64_t row_off, @@ -7071,7 +7105,7 @@ struct TALER_EXCHANGEDB_Plugin * @return database transaction status */ enum GNUNET_DB_QueryStatus - (*select_aml_history)( + (*select_aml_history)( void *cls, const struct TALER_PaytoHashP *h_payto, TALER_EXCHANGEDB_AmlHistoryCallback cb, @@ -7098,7 +7132,7 @@ struct TALER_EXCHANGEDB_Plugin * @return database transaction status */ enum GNUNET_DB_QueryStatus - (*insert_aml_decision)( + (*insert_aml_decision)( void *cls, const struct TALER_PaytoHashP *h_payto, const struct TALER_Amount *new_threshold, |