rename for consistency
This commit is contained in:
parent
7dd52a0892
commit
a49bfef2fb
@ -1641,7 +1641,7 @@ verify_reserve_balance (void *cls,
|
||||
|
||||
ret = GNUNET_OK;
|
||||
reserve.pub = rs->reserve_pub;
|
||||
qs = edb->reserve_get (edb->cls,
|
||||
qs = edb->reserves_get (edb->cls,
|
||||
esession,
|
||||
&reserve);
|
||||
if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT != qs)
|
||||
@ -1956,7 +1956,7 @@ analyze_reserves (void *cls)
|
||||
GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qs);
|
||||
return qs;
|
||||
}
|
||||
qs = edb->select_reserves_out_above_serial_id (edb->cls,
|
||||
qs = edb->select_withdrawals_above_serial_id (edb->cls,
|
||||
esession,
|
||||
ppr.last_reserve_out_serial_id,
|
||||
&handle_reserve_out,
|
||||
@ -4712,7 +4712,7 @@ analyze_coins (void *cls)
|
||||
|
||||
/* process withdrawals */
|
||||
if (0 >
|
||||
(qs = edb->select_reserves_out_above_serial_id (edb->cls,
|
||||
(qs = edb->select_withdrawals_above_serial_id (edb->cls,
|
||||
esession,
|
||||
ppc.
|
||||
last_withdraw_serial_id,
|
||||
@ -4741,7 +4741,7 @@ analyze_coins (void *cls)
|
||||
|
||||
/* process refreshs */
|
||||
if (0 >
|
||||
(qs = edb->select_refreshs_above_serial_id (edb->cls,
|
||||
(qs = edb->select_refreshes_above_serial_id (edb->cls,
|
||||
esession,
|
||||
ppc.last_melt_serial_id,
|
||||
&refresh_session_cb,
|
||||
|
@ -234,7 +234,7 @@ withdraw_transaction (void *cls,
|
||||
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
|
||||
"Trying to withdraw from reserve: %s\n",
|
||||
TALER_B2S (&r.pub));
|
||||
qs = TEH_plugin->reserve_get (TEH_plugin->cls,
|
||||
qs = TEH_plugin->reserves_get (TEH_plugin->cls,
|
||||
session,
|
||||
&r);
|
||||
if (0 > qs)
|
||||
|
@ -341,8 +341,8 @@ postgres_get_session (void *cls)
|
||||
" FROM denomination_revocations"
|
||||
" WHERE denom_pub_hash=$1;",
|
||||
1),
|
||||
/* Used in #postgres_reserve_get() */
|
||||
GNUNET_PQ_make_prepare ("reserve_get",
|
||||
/* Used in #postgres_reserves_get() */
|
||||
GNUNET_PQ_make_prepare ("reserves_get",
|
||||
"SELECT"
|
||||
" current_balance_val"
|
||||
",current_balance_frac"
|
||||
@ -525,7 +525,7 @@ postgres_get_session (void *cls)
|
||||
" WHERE reserve_pub=$1"
|
||||
" FOR UPDATE",
|
||||
1),
|
||||
/* Used in #postgres_select_reserves_out_above_serial_id() */
|
||||
/* Used in #postgres_select_withdrawals_above_serial_id() */
|
||||
GNUNET_PQ_make_prepare ("audit_get_reserves_out_incr",
|
||||
"SELECT"
|
||||
" h_blind_ev"
|
||||
@ -628,7 +628,7 @@ postgres_get_session (void *cls)
|
||||
" FROM refresh_commitments"
|
||||
" WHERE rc=$1;",
|
||||
1),
|
||||
/* Used in #postgres_select_refreshs_above_serial_id() to fetch
|
||||
/* Used in #postgres_select_refreshes_above_serial_id() to fetch
|
||||
refresh session with id '\geq' the given parameter */
|
||||
GNUNET_PQ_make_prepare ("audit_get_refresh_commitments_incr",
|
||||
"SELECT"
|
||||
@ -906,7 +906,8 @@ postgres_get_session (void *cls)
|
||||
" done=FALSE"
|
||||
" ORDER BY wire_deadline ASC"
|
||||
" LIMIT "
|
||||
TALER_EXCHANGEDB_MATCHING_DEPOSITS_LIMIT_STR ";",
|
||||
TALER_QUOTE (
|
||||
TALER_EXCHANGEDB_MATCHING_DEPOSITS_LIMIT) ";",
|
||||
2),
|
||||
/* Used in #postgres_mark_deposit_tiny() */
|
||||
GNUNET_PQ_make_prepare ("mark_deposit_tiny",
|
||||
@ -1687,7 +1688,7 @@ struct DenomIteratorContext
|
||||
/**
|
||||
* Function to call with the results.
|
||||
*/
|
||||
TALER_EXCHANGEDB_DenominationInfoIterator cb;
|
||||
TALER_EXCHANGEDB_DenominationCallback cb;
|
||||
|
||||
/**
|
||||
* Closure to pass to @e cb
|
||||
@ -1781,7 +1782,7 @@ domination_cb_helper (void *cls,
|
||||
*/
|
||||
static enum GNUNET_DB_QueryStatus
|
||||
postgres_iterate_denomination_info (void *cls,
|
||||
TALER_EXCHANGEDB_DenominationInfoIterator cb,
|
||||
TALER_EXCHANGEDB_DenominationCallback cb,
|
||||
void *cb_cls)
|
||||
{
|
||||
struct PostgresClosure *pc = cls;
|
||||
@ -1813,7 +1814,7 @@ postgres_iterate_denomination_info (void *cls,
|
||||
* @return transaction status
|
||||
*/
|
||||
static enum GNUNET_DB_QueryStatus
|
||||
postgres_reserve_get (void *cls,
|
||||
postgres_reserves_get (void *cls,
|
||||
struct TALER_EXCHANGEDB_Session *session,
|
||||
struct TALER_EXCHANGEDB_Reserve *reserve)
|
||||
{
|
||||
@ -1830,7 +1831,7 @@ postgres_reserve_get (void *cls,
|
||||
};
|
||||
|
||||
return GNUNET_PQ_eval_prepared_singleton_select (session->conn,
|
||||
"reserve_get",
|
||||
"reserves_get",
|
||||
params,
|
||||
rs);
|
||||
}
|
||||
@ -1897,7 +1898,7 @@ postgres_reserves_in_insert (void *cls,
|
||||
struct GNUNET_TIME_Absolute expiry;
|
||||
|
||||
reserve.pub = *reserve_pub;
|
||||
reserve_exists = postgres_reserve_get (cls,
|
||||
reserve_exists = postgres_reserves_get (cls,
|
||||
session,
|
||||
&reserve);
|
||||
if (0 > reserve_exists)
|
||||
@ -2141,7 +2142,7 @@ postgres_insert_withdraw_info (void *cls,
|
||||
/* update reserve balance */
|
||||
reserve.pub = collectable->reserve_pub;
|
||||
if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
|
||||
(qs = postgres_reserve_get (cls,
|
||||
(qs = postgres_reserves_get (cls,
|
||||
session,
|
||||
&reserve)))
|
||||
{
|
||||
@ -4664,7 +4665,8 @@ postgres_wire_lookup_deposit_wtid (void *cls,
|
||||
TALER_CoinSpendPublicKeyP *coin_pub,
|
||||
const struct
|
||||
TALER_MerchantPublicKeyP *merchant_pub,
|
||||
TALER_EXCHANGEDB_TrackTransactionCallback cb,
|
||||
TALER_EXCHANGEDB_WireTransferByCoinCallback
|
||||
cb,
|
||||
void *cb_cls)
|
||||
{
|
||||
struct PostgresClosure *pg = cls;
|
||||
@ -5086,7 +5088,7 @@ postgres_insert_reserve_closed (void *cls,
|
||||
/* update reserve balance */
|
||||
reserve.pub = *reserve_pub;
|
||||
if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
|
||||
(qs = postgres_reserve_get (cls,
|
||||
(qs = postgres_reserves_get (cls,
|
||||
session,
|
||||
&reserve)))
|
||||
{
|
||||
@ -5658,7 +5660,7 @@ refreshs_serial_helper_cb (void *cls,
|
||||
* @return transaction status code
|
||||
*/
|
||||
static enum GNUNET_DB_QueryStatus
|
||||
postgres_select_refreshs_above_serial_id (void *cls,
|
||||
postgres_select_refreshes_above_serial_id (void *cls,
|
||||
struct TALER_EXCHANGEDB_Session *
|
||||
session,
|
||||
uint64_t serial_id,
|
||||
@ -6120,7 +6122,7 @@ reserves_out_serial_helper_cb (void *cls,
|
||||
* @return transaction status code
|
||||
*/
|
||||
static enum GNUNET_DB_QueryStatus
|
||||
postgres_select_reserves_out_above_serial_id (void *cls,
|
||||
postgres_select_withdrawals_above_serial_id (void *cls,
|
||||
struct TALER_EXCHANGEDB_Session *
|
||||
session,
|
||||
uint64_t serial_id,
|
||||
@ -6830,7 +6832,7 @@ postgres_insert_recoup_request (void *cls,
|
||||
|
||||
/* Update reserve balance */
|
||||
reserve.pub = *reserve_pub;
|
||||
qs = postgres_reserve_get (cls,
|
||||
qs = postgres_reserves_get (cls,
|
||||
session,
|
||||
&reserve);
|
||||
if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT != qs)
|
||||
@ -7281,7 +7283,7 @@ libtaler_plugin_exchangedb_postgres_init (void *cls)
|
||||
plugin->insert_denomination_info = &postgres_insert_denomination_info;
|
||||
plugin->get_denomination_info = &postgres_get_denomination_info;
|
||||
plugin->iterate_denomination_info = &postgres_iterate_denomination_info;
|
||||
plugin->reserve_get = &postgres_reserve_get;
|
||||
plugin->reserves_get = &postgres_reserves_get;
|
||||
plugin->reserves_in_insert = &postgres_reserves_in_insert;
|
||||
plugin->get_latest_reserve_in_reference =
|
||||
&postgres_get_latest_reserve_in_reference;
|
||||
@ -7326,16 +7328,16 @@ libtaler_plugin_exchangedb_postgres_init (void *cls)
|
||||
plugin->gc = &postgres_gc;
|
||||
plugin->select_deposits_above_serial_id
|
||||
= &postgres_select_deposits_above_serial_id;
|
||||
plugin->select_refreshs_above_serial_id
|
||||
= &postgres_select_refreshs_above_serial_id;
|
||||
plugin->select_refreshes_above_serial_id
|
||||
= &postgres_select_refreshes_above_serial_id;
|
||||
plugin->select_refunds_above_serial_id
|
||||
= &postgres_select_refunds_above_serial_id;
|
||||
plugin->select_reserves_in_above_serial_id
|
||||
= &postgres_select_reserves_in_above_serial_id;
|
||||
plugin->select_reserves_in_above_serial_id_by_account
|
||||
= &postgres_select_reserves_in_above_serial_id_by_account;
|
||||
plugin->select_reserves_out_above_serial_id
|
||||
= &postgres_select_reserves_out_above_serial_id;
|
||||
plugin->select_withdrawals_above_serial_id
|
||||
= &postgres_select_withdrawals_above_serial_id;
|
||||
plugin->select_wire_out_above_serial_id
|
||||
= &postgres_select_wire_out_above_serial_id;
|
||||
plugin->select_wire_out_above_serial_id_by_account
|
||||
|
@ -163,7 +163,7 @@ check_reserve (struct TALER_EXCHANGEDB_Session *session,
|
||||
|
||||
reserve.pub = *pub;
|
||||
FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
|
||||
plugin->reserve_get (plugin->cls,
|
||||
plugin->reserves_get (plugin->cls,
|
||||
session,
|
||||
&reserve));
|
||||
FAILIF (value != reserve.balance.value);
|
||||
@ -572,10 +572,10 @@ test_melting (struct TALER_EXCHANGEDB_Session *session)
|
||||
GNUNET_memcmp (&refresh_session.coin.denom_pub_hash,
|
||||
&ret_refresh_session.session.coin.denom_pub_hash));
|
||||
|
||||
/* test 'select_refreshs_above_serial_id' */
|
||||
/* test 'select_refreshes_above_serial_id' */
|
||||
auditor_row_cnt = 0;
|
||||
FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
|
||||
plugin->select_refreshs_above_serial_id (plugin->cls,
|
||||
plugin->select_refreshes_above_serial_id (plugin->cls,
|
||||
session,
|
||||
0,
|
||||
&audit_refresh_session_cb,
|
||||
@ -1776,7 +1776,7 @@ run (void *cls)
|
||||
&audit_reserve_in_cb,
|
||||
NULL));
|
||||
FAILIF (0 >=
|
||||
plugin->select_reserves_out_above_serial_id (plugin->cls,
|
||||
plugin->select_withdrawals_above_serial_id (plugin->cls,
|
||||
session,
|
||||
0,
|
||||
&audit_reserve_out_cb,
|
||||
|
@ -379,7 +379,7 @@ struct TALER_EXCHANGEDB_RecoupRefreshListEntry
|
||||
struct TALER_CoinSpendSignatureP coin_sig;
|
||||
|
||||
/**
|
||||
* Public key of the old coin that the refresh'ed coin was paid back to.
|
||||
* Public key of the old coin that the refreshed coin was paid back to.
|
||||
*/
|
||||
struct TALER_CoinSpendPublicKeyP old_coin_pub;
|
||||
|
||||
@ -1276,9 +1276,10 @@ typedef void
|
||||
* when we expect it to be done (if @a wtid was NULL)
|
||||
*/
|
||||
typedef void
|
||||
(*TALER_EXCHANGEDB_TrackTransactionCallback)(void *cls,
|
||||
(*TALER_EXCHANGEDB_WireTransferByCoinCallback)(void *cls,
|
||||
const struct
|
||||
TALER_WireTransferIdentifierRawP *
|
||||
TALER_WireTransferIdentifierRawP
|
||||
*
|
||||
wtid,
|
||||
const struct
|
||||
TALER_Amount *coin_contribution,
|
||||
@ -1547,10 +1548,9 @@ typedef void
|
||||
* @param issue detailed information about the denomination (value, expiration times, fees)
|
||||
*/
|
||||
typedef void
|
||||
(*TALER_EXCHANGEDB_DenominationInfoIterator)(void *cls,
|
||||
(*TALER_EXCHANGEDB_DenominationCallback)(void *cls,
|
||||
const struct
|
||||
TALER_DenominationPublicKey *
|
||||
denom_pub,
|
||||
TALER_DenominationPublicKey *denom_pub,
|
||||
const struct
|
||||
TALER_EXCHANGEDB_DenominationKeyInformationP
|
||||
*issue);
|
||||
@ -1575,7 +1575,7 @@ struct TALER_EXCHANGEDB_Plugin
|
||||
char *library_name;
|
||||
|
||||
/**
|
||||
* Get the thread-local database-handle.
|
||||
* Get the thread-local (!) database-handle.
|
||||
* Connect to the db if the connection does not exist yet.
|
||||
*
|
||||
* @param cls the @e cls of this struct with the plugin-specific state
|
||||
@ -1705,7 +1705,7 @@ struct TALER_EXCHANGEDB_Plugin
|
||||
*/
|
||||
enum GNUNET_DB_QueryStatus
|
||||
(*iterate_denomination_info)(void *cls,
|
||||
TALER_EXCHANGEDB_DenominationInfoIterator cb,
|
||||
TALER_EXCHANGEDB_DenominationCallback cb,
|
||||
void *cb_cls);
|
||||
|
||||
/**
|
||||
@ -1719,7 +1719,7 @@ struct TALER_EXCHANGEDB_Plugin
|
||||
* @return transaction status
|
||||
*/
|
||||
enum GNUNET_DB_QueryStatus
|
||||
(*reserve_get)(void *cls,
|
||||
(*reserves_get)(void *cls,
|
||||
struct TALER_EXCHANGEDB_Session *session,
|
||||
struct TALER_EXCHANGEDB_Reserve *reserve);
|
||||
|
||||
@ -1750,6 +1750,7 @@ struct TALER_EXCHANGEDB_Plugin
|
||||
|
||||
/**
|
||||
* Obtain the most recent @a wire_reference that was inserted via @e reserves_in_insert.
|
||||
* Used by the wirewatch process when resuming.
|
||||
*
|
||||
* @param cls the @e cls of this struct with the plugin-specific state
|
||||
* @param session the database connection handle
|
||||
@ -1766,8 +1767,9 @@ struct TALER_EXCHANGEDB_Plugin
|
||||
|
||||
|
||||
/**
|
||||
* Locate the response for a /withdraw request under the
|
||||
* key of the hash of the blinded message.
|
||||
* Locate the response for a withdraw request under the
|
||||
* key of the hash of the blinded message. Used to ensure
|
||||
* idempotency of the request.
|
||||
*
|
||||
* @param cls the @e cls of this struct with the plugin-specific state
|
||||
* @param session database connection to use
|
||||
@ -1785,8 +1787,8 @@ struct TALER_EXCHANGEDB_Plugin
|
||||
|
||||
|
||||
/**
|
||||
* Store collectable bit coin under the corresponding
|
||||
* hash of the blinded message.
|
||||
* Store collectable coin under the corresponding hash of the blinded
|
||||
* message.
|
||||
*
|
||||
* @param cls the @e cls of this struct with the plugin-specific state
|
||||
* @param session database connection to use
|
||||
@ -1933,6 +1935,7 @@ struct TALER_EXCHANGEDB_Plugin
|
||||
struct TALER_EXCHANGEDB_Session *session,
|
||||
const struct TALER_EXCHANGEDB_Refund *refund);
|
||||
|
||||
|
||||
/**
|
||||
* Select refunds by @a coin_pub, @a merchant_pub and @a h_contract.
|
||||
*
|
||||
@ -1956,9 +1959,9 @@ struct TALER_EXCHANGEDB_Plugin
|
||||
|
||||
|
||||
/**
|
||||
* Mark a deposit as tiny, thereby declaring that it cannot be
|
||||
* executed by itself and should no longer be returned by
|
||||
* @e iterate_ready_deposits()
|
||||
* Mark a deposit as tiny, thereby declaring that it cannot be executed by
|
||||
* itself (only included in a larger aggregation) and should no longer be
|
||||
* returned by @e iterate_ready_deposits()
|
||||
*
|
||||
* @param cls the @e cls of this struct with the plugin-specific state
|
||||
* @param session connection to the database
|
||||
@ -2037,7 +2040,6 @@ struct TALER_EXCHANGEDB_Plugin
|
||||
* "tiny" threshold beyond which we never trigger a wire transaction!
|
||||
*/
|
||||
#define TALER_EXCHANGEDB_MATCHING_DEPOSITS_LIMIT 10000
|
||||
#define TALER_EXCHANGEDB_MATCHING_DEPOSITS_LIMIT_STR "10000"
|
||||
|
||||
/**
|
||||
* Obtain information about other pending deposits for the same
|
||||
@ -2067,7 +2069,7 @@ struct TALER_EXCHANGEDB_Plugin
|
||||
|
||||
|
||||
/**
|
||||
* Store new refresh melt commitment data.
|
||||
* Store new melt commitment data.
|
||||
*
|
||||
* @param cls the @e cls of this struct with the plugin-specific state
|
||||
* @param session database handle to use
|
||||
@ -2081,7 +2083,7 @@ struct TALER_EXCHANGEDB_Plugin
|
||||
|
||||
|
||||
/**
|
||||
* Lookup refresh melt commitment data under the given @a rc.
|
||||
* Lookup melt commitment data under the given @a rc.
|
||||
*
|
||||
* @param cls the @e cls of this struct with the plugin-specific state
|
||||
* @param session database handle to use
|
||||
@ -2256,7 +2258,7 @@ struct TALER_EXCHANGEDB_Plugin
|
||||
const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
||||
const struct
|
||||
TALER_MerchantPublicKeyP *merchant_pub,
|
||||
TALER_EXCHANGEDB_TrackTransactionCallback cb,
|
||||
TALER_EXCHANGEDB_WireTransferByCoinCallback cb,
|
||||
void *cb_cls);
|
||||
|
||||
|
||||
@ -2500,7 +2502,7 @@ struct TALER_EXCHANGEDB_Plugin
|
||||
* @return transaction status code
|
||||
*/
|
||||
enum GNUNET_DB_QueryStatus
|
||||
(*select_refreshs_above_serial_id)(void *cls,
|
||||
(*select_refreshes_above_serial_id)(void *cls,
|
||||
struct TALER_EXCHANGEDB_Session *session,
|
||||
uint64_t serial_id,
|
||||
TALER_EXCHANGEDB_RefreshesCallback cb,
|
||||
@ -2580,7 +2582,7 @@ struct TALER_EXCHANGEDB_Plugin
|
||||
* @return transaction status code
|
||||
*/
|
||||
enum GNUNET_DB_QueryStatus
|
||||
(*select_reserves_out_above_serial_id)(void *cls,
|
||||
(*select_withdrawals_above_serial_id)(void *cls,
|
||||
struct TALER_EXCHANGEDB_Session *
|
||||
session,
|
||||
uint64_t serial_id,
|
||||
|
@ -26,6 +26,22 @@
|
||||
#include "taler_amount_lib.h"
|
||||
#include "taler_crypto_lib.h"
|
||||
|
||||
/**
|
||||
* Stringify operator.
|
||||
*
|
||||
* @param a some expression to stringify. Must NOT be a macro.
|
||||
* @return same expression as a constant string.
|
||||
*/
|
||||
#define TALER_S(a) #a
|
||||
|
||||
/**
|
||||
* Stringify operator.
|
||||
*
|
||||
* @param a some expression to stringify. Can be a macro.
|
||||
* @return macro-expanded expression as a constant string.
|
||||
*/
|
||||
#define TALER_QUOTE(a) TALER_S (a)
|
||||
|
||||
|
||||
/* Define logging functions */
|
||||
#define TALER_LOG_DEBUG(...) \
|
||||
|
Loading…
Reference in New Issue
Block a user