introduce 'struct TALER_AUDITORDB_ProgressPoint'
This commit is contained in:
parent
af5810ccae
commit
a3db0d4a8c
@ -78,32 +78,7 @@ static struct TALER_MasterPublicKeyP master_pub;
|
|||||||
/**
|
/**
|
||||||
* Last reserve_in serial ID seen.
|
* Last reserve_in serial ID seen.
|
||||||
*/
|
*/
|
||||||
static uint64_t reserve_in_serial_id;
|
static struct TALER_AUDITORDB_ProgressPoint pp;
|
||||||
|
|
||||||
/**
|
|
||||||
* Last reserve_out serial ID seen.
|
|
||||||
*/
|
|
||||||
static uint64_t reserve_out_serial_id;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Last deposit serial ID seen.
|
|
||||||
*/
|
|
||||||
static uint64_t deposit_serial_id;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Last melt serial ID seen.
|
|
||||||
*/
|
|
||||||
static uint64_t melt_serial_id;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Last deposit refund ID seen.
|
|
||||||
*/
|
|
||||||
static uint64_t refund_serial_id;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Last prewire serial ID seen.
|
|
||||||
*/
|
|
||||||
static uint64_t prewire_serial_id;
|
|
||||||
|
|
||||||
|
|
||||||
/* ***************************** Report logic **************************** */
|
/* ***************************** Report logic **************************** */
|
||||||
@ -486,8 +461,8 @@ handle_reserve_in (void *cls,
|
|||||||
struct ReserveSummary *rs;
|
struct ReserveSummary *rs;
|
||||||
struct GNUNET_TIME_Absolute expiry;
|
struct GNUNET_TIME_Absolute expiry;
|
||||||
|
|
||||||
GNUNET_assert (rowid >= reserve_in_serial_id); /* should be monotonically increasing */
|
GNUNET_assert (rowid >= pp.last_reserve_in_serial_id); /* should be monotonically increasing */
|
||||||
reserve_in_serial_id = rowid + 1;
|
pp.last_reserve_in_serial_id = rowid + 1;
|
||||||
GNUNET_CRYPTO_hash (reserve_pub,
|
GNUNET_CRYPTO_hash (reserve_pub,
|
||||||
sizeof (*reserve_pub),
|
sizeof (*reserve_pub),
|
||||||
&key);
|
&key);
|
||||||
@ -570,8 +545,8 @@ handle_reserve_out (void *cls,
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
/* should be monotonically increasing */
|
/* should be monotonically increasing */
|
||||||
GNUNET_assert (rowid >= reserve_out_serial_id);
|
GNUNET_assert (rowid >= pp.last_reserve_out_serial_id);
|
||||||
reserve_out_serial_id = rowid + 1;
|
pp.last_reserve_out_serial_id = rowid + 1;
|
||||||
|
|
||||||
/* lookup denomination pub data (make sure denom_pub is valid, establish fees) */
|
/* lookup denomination pub data (make sure denom_pub is valid, establish fees) */
|
||||||
ret = get_denomination_info (denom_pub,
|
ret = get_denomination_info (denom_pub,
|
||||||
@ -872,7 +847,7 @@ analyze_reserves (void *cls)
|
|||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
edb->select_reserves_in_above_serial_id (edb->cls,
|
edb->select_reserves_in_above_serial_id (edb->cls,
|
||||||
esession,
|
esession,
|
||||||
reserve_in_serial_id,
|
pp.last_reserve_in_serial_id,
|
||||||
&handle_reserve_in,
|
&handle_reserve_in,
|
||||||
&rc))
|
&rc))
|
||||||
{
|
{
|
||||||
@ -882,7 +857,7 @@ analyze_reserves (void *cls)
|
|||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
edb->select_reserves_out_above_serial_id (edb->cls,
|
edb->select_reserves_out_above_serial_id (edb->cls,
|
||||||
esession,
|
esession,
|
||||||
reserve_out_serial_id,
|
pp.last_reserve_out_serial_id,
|
||||||
&handle_reserve_out,
|
&handle_reserve_out,
|
||||||
&rc))
|
&rc))
|
||||||
{
|
{
|
||||||
@ -1147,12 +1122,7 @@ incremental_processing (Analysis analysis,
|
|||||||
ret = adb->get_auditor_progress (adb->cls,
|
ret = adb->get_auditor_progress (adb->cls,
|
||||||
asession,
|
asession,
|
||||||
&master_pub,
|
&master_pub,
|
||||||
&reserve_in_serial_id,
|
&pp);
|
||||||
&reserve_out_serial_id,
|
|
||||||
&deposit_serial_id,
|
|
||||||
&melt_serial_id,
|
|
||||||
&refund_serial_id,
|
|
||||||
&prewire_serial_id);
|
|
||||||
if (GNUNET_SYSERR == ret)
|
if (GNUNET_SYSERR == ret)
|
||||||
{
|
{
|
||||||
GNUNET_break (0);
|
GNUNET_break (0);
|
||||||
@ -1167,12 +1137,12 @@ incremental_processing (Analysis analysis,
|
|||||||
{
|
{
|
||||||
GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE,
|
GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE,
|
||||||
_("Resuming audit at %llu/%llu/%llu/%llu/%llu/%llu\n\n"),
|
_("Resuming audit at %llu/%llu/%llu/%llu/%llu/%llu\n\n"),
|
||||||
(unsigned long long) reserve_in_serial_id,
|
(unsigned long long) pp.last_reserve_in_serial_id,
|
||||||
(unsigned long long) reserve_out_serial_id,
|
(unsigned long long) pp.last_reserve_out_serial_id,
|
||||||
(unsigned long long) deposit_serial_id,
|
(unsigned long long) pp.last_deposit_serial_id,
|
||||||
(unsigned long long) melt_serial_id,
|
(unsigned long long) pp.last_melt_serial_id,
|
||||||
(unsigned long long) refund_serial_id,
|
(unsigned long long) pp.last_refund_serial_id,
|
||||||
(unsigned long long) prewire_serial_id);
|
(unsigned long long) pp.last_prewire_serial_id);
|
||||||
}
|
}
|
||||||
ret = analysis (analysis_cls);
|
ret = analysis (analysis_cls);
|
||||||
if (GNUNET_OK != ret)
|
if (GNUNET_OK != ret)
|
||||||
@ -1184,12 +1154,7 @@ incremental_processing (Analysis analysis,
|
|||||||
ret = adb->update_auditor_progress (adb->cls,
|
ret = adb->update_auditor_progress (adb->cls,
|
||||||
asession,
|
asession,
|
||||||
&master_pub,
|
&master_pub,
|
||||||
reserve_in_serial_id,
|
&pp);
|
||||||
reserve_out_serial_id,
|
|
||||||
deposit_serial_id,
|
|
||||||
melt_serial_id,
|
|
||||||
refund_serial_id,
|
|
||||||
prewire_serial_id);
|
|
||||||
if (GNUNET_OK != ret)
|
if (GNUNET_OK != ret)
|
||||||
{
|
{
|
||||||
GNUNET_break (0);
|
GNUNET_break (0);
|
||||||
@ -1197,12 +1162,12 @@ incremental_processing (Analysis analysis,
|
|||||||
}
|
}
|
||||||
GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE,
|
GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE,
|
||||||
_("Resuming audit at %llu/%llu/%llu/%llu/%llu/%llu\n\n"),
|
_("Resuming audit at %llu/%llu/%llu/%llu/%llu/%llu\n\n"),
|
||||||
(unsigned long long) reserve_in_serial_id,
|
(unsigned long long) pp.last_reserve_in_serial_id,
|
||||||
(unsigned long long) reserve_out_serial_id,
|
(unsigned long long) pp.last_reserve_out_serial_id,
|
||||||
(unsigned long long) deposit_serial_id,
|
(unsigned long long) pp.last_deposit_serial_id,
|
||||||
(unsigned long long) melt_serial_id,
|
(unsigned long long) pp.last_melt_serial_id,
|
||||||
(unsigned long long) refund_serial_id,
|
(unsigned long long) pp.last_refund_serial_id,
|
||||||
(unsigned long long) prewire_serial_id);
|
(unsigned long long) pp.last_prewire_serial_id);
|
||||||
return GNUNET_OK;
|
return GNUNET_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1199,18 +1199,15 @@ postgres_insert_denomination_info (void *cls,
|
|||||||
struct GNUNET_PQ_QueryParam params[] = {
|
struct GNUNET_PQ_QueryParam params[] = {
|
||||||
GNUNET_PQ_query_param_auto_from_type (&issue->denom_hash),
|
GNUNET_PQ_query_param_auto_from_type (&issue->denom_hash),
|
||||||
GNUNET_PQ_query_param_auto_from_type (&issue->master),
|
GNUNET_PQ_query_param_auto_from_type (&issue->master),
|
||||||
|
|
||||||
GNUNET_PQ_query_param_auto_from_type (&issue->start),
|
GNUNET_PQ_query_param_auto_from_type (&issue->start),
|
||||||
GNUNET_PQ_query_param_auto_from_type (&issue->expire_withdraw),
|
GNUNET_PQ_query_param_auto_from_type (&issue->expire_withdraw),
|
||||||
GNUNET_PQ_query_param_auto_from_type (&issue->expire_deposit),
|
GNUNET_PQ_query_param_auto_from_type (&issue->expire_deposit),
|
||||||
GNUNET_PQ_query_param_auto_from_type (&issue->expire_legal),
|
GNUNET_PQ_query_param_auto_from_type (&issue->expire_legal),
|
||||||
|
|
||||||
TALER_PQ_query_param_amount_nbo (&issue->value),
|
TALER_PQ_query_param_amount_nbo (&issue->value),
|
||||||
TALER_PQ_query_param_amount_nbo (&issue->fee_withdraw),
|
TALER_PQ_query_param_amount_nbo (&issue->fee_withdraw),
|
||||||
TALER_PQ_query_param_amount_nbo (&issue->fee_deposit),
|
TALER_PQ_query_param_amount_nbo (&issue->fee_deposit),
|
||||||
TALER_PQ_query_param_amount_nbo (&issue->fee_refresh),
|
TALER_PQ_query_param_amount_nbo (&issue->fee_refresh),
|
||||||
TALER_PQ_query_param_amount_nbo (&issue->fee_refund),
|
TALER_PQ_query_param_amount_nbo (&issue->fee_refund),
|
||||||
|
|
||||||
GNUNET_PQ_query_param_end
|
GNUNET_PQ_query_param_end
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -1264,7 +1261,6 @@ postgres_select_denomination_info (void *cls,
|
|||||||
{
|
{
|
||||||
struct GNUNET_PQ_QueryParam params[] = {
|
struct GNUNET_PQ_QueryParam params[] = {
|
||||||
GNUNET_PQ_query_param_auto_from_type (master_pub),
|
GNUNET_PQ_query_param_auto_from_type (master_pub),
|
||||||
|
|
||||||
GNUNET_PQ_query_param_end
|
GNUNET_PQ_query_param_end
|
||||||
};
|
};
|
||||||
PGresult *result;
|
PGresult *result;
|
||||||
@ -1294,18 +1290,15 @@ postgres_select_denomination_info (void *cls,
|
|||||||
|
|
||||||
struct GNUNET_PQ_ResultSpec rs[] = {
|
struct GNUNET_PQ_ResultSpec rs[] = {
|
||||||
GNUNET_PQ_result_spec_auto_from_type ("denom_pub_hash", &issue.denom_hash),
|
GNUNET_PQ_result_spec_auto_from_type ("denom_pub_hash", &issue.denom_hash),
|
||||||
|
|
||||||
GNUNET_PQ_result_spec_auto_from_type ("valid_from", &issue.start),
|
GNUNET_PQ_result_spec_auto_from_type ("valid_from", &issue.start),
|
||||||
GNUNET_PQ_result_spec_auto_from_type ("expire_withdraw", &issue.expire_withdraw),
|
GNUNET_PQ_result_spec_auto_from_type ("expire_withdraw", &issue.expire_withdraw),
|
||||||
GNUNET_PQ_result_spec_auto_from_type ("expire_deposit", &issue.expire_deposit),
|
GNUNET_PQ_result_spec_auto_from_type ("expire_deposit", &issue.expire_deposit),
|
||||||
GNUNET_PQ_result_spec_auto_from_type ("expire_legal", &issue.expire_legal),
|
GNUNET_PQ_result_spec_auto_from_type ("expire_legal", &issue.expire_legal),
|
||||||
|
|
||||||
TALER_PQ_result_spec_amount_nbo ("coin", &issue.value),
|
TALER_PQ_result_spec_amount_nbo ("coin", &issue.value),
|
||||||
TALER_PQ_result_spec_amount_nbo ("fee_withdraw", &issue.fee_withdraw),
|
TALER_PQ_result_spec_amount_nbo ("fee_withdraw", &issue.fee_withdraw),
|
||||||
TALER_PQ_result_spec_amount_nbo ("fee_deposit", &issue.fee_deposit),
|
TALER_PQ_result_spec_amount_nbo ("fee_deposit", &issue.fee_deposit),
|
||||||
TALER_PQ_result_spec_amount_nbo ("fee_refresh", &issue.fee_refresh),
|
TALER_PQ_result_spec_amount_nbo ("fee_refresh", &issue.fee_refresh),
|
||||||
TALER_PQ_result_spec_amount_nbo ("fee_refund", &issue.fee_refund),
|
TALER_PQ_result_spec_amount_nbo ("fee_refund", &issue.fee_refund),
|
||||||
|
|
||||||
GNUNET_PQ_result_spec_end
|
GNUNET_PQ_result_spec_end
|
||||||
};
|
};
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
@ -1338,39 +1331,27 @@ postgres_select_denomination_info (void *cls,
|
|||||||
* @param cls the @e cls of this struct with the plugin-specific state
|
* @param cls the @e cls of this struct with the plugin-specific state
|
||||||
* @param session connection to use
|
* @param session connection to use
|
||||||
* @param master_pub master key of the exchange
|
* @param master_pub master key of the exchange
|
||||||
* @param last_reserve_in_serial_id serial ID of the last reserve_in transfer the auditor processed
|
* @param pp where is the auditor in processing
|
||||||
* @param last_reserve_out_serial_id serial ID of the last withdraw the auditor processed
|
|
||||||
* @param last_deposit_serial_id serial ID of the last deposit the auditor processed
|
|
||||||
* @param last_melt_serial_id serial ID of the last refresh the auditor processed
|
|
||||||
* @param last_prewire_serial_id serial ID of the last prewire transfer the auditor processed
|
|
||||||
* @return #GNUNET_OK on success; #GNUNET_SYSERR on failure
|
* @return #GNUNET_OK on success; #GNUNET_SYSERR on failure
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
postgres_insert_auditor_progress (void *cls,
|
postgres_insert_auditor_progress (void *cls,
|
||||||
struct TALER_AUDITORDB_Session *session,
|
struct TALER_AUDITORDB_Session *session,
|
||||||
const struct TALER_MasterPublicKeyP *master_pub,
|
const struct TALER_MasterPublicKeyP *master_pub,
|
||||||
uint64_t last_reserve_in_serial_id,
|
const struct TALER_AUDITORDB_ProgressPoint *pp)
|
||||||
uint64_t last_reserve_out_serial_id,
|
|
||||||
uint64_t last_deposit_serial_id,
|
|
||||||
uint64_t last_melt_serial_id,
|
|
||||||
uint64_t last_refund_serial_id,
|
|
||||||
uint64_t last_prewire_serial_id)
|
|
||||||
{
|
{
|
||||||
PGresult *result;
|
PGresult *result;
|
||||||
int ret;
|
|
||||||
|
|
||||||
struct GNUNET_PQ_QueryParam params[] = {
|
struct GNUNET_PQ_QueryParam params[] = {
|
||||||
GNUNET_PQ_query_param_auto_from_type (master_pub),
|
GNUNET_PQ_query_param_auto_from_type (master_pub),
|
||||||
|
GNUNET_PQ_query_param_uint64 (&pp->last_reserve_in_serial_id),
|
||||||
GNUNET_PQ_query_param_uint64 (&last_reserve_in_serial_id),
|
GNUNET_PQ_query_param_uint64 (&pp->last_reserve_out_serial_id),
|
||||||
GNUNET_PQ_query_param_uint64 (&last_reserve_out_serial_id),
|
GNUNET_PQ_query_param_uint64 (&pp->last_deposit_serial_id),
|
||||||
GNUNET_PQ_query_param_uint64 (&last_deposit_serial_id),
|
GNUNET_PQ_query_param_uint64 (&pp->last_melt_serial_id),
|
||||||
GNUNET_PQ_query_param_uint64 (&last_melt_serial_id),
|
GNUNET_PQ_query_param_uint64 (&pp->last_refund_serial_id),
|
||||||
GNUNET_PQ_query_param_uint64 (&last_refund_serial_id),
|
GNUNET_PQ_query_param_uint64 (&pp->last_prewire_serial_id),
|
||||||
GNUNET_PQ_query_param_uint64 (&last_prewire_serial_id),
|
|
||||||
|
|
||||||
GNUNET_PQ_query_param_end
|
GNUNET_PQ_query_param_end
|
||||||
};
|
};
|
||||||
|
int ret;
|
||||||
|
|
||||||
result = GNUNET_PQ_exec_prepared (session->conn,
|
result = GNUNET_PQ_exec_prepared (session->conn,
|
||||||
"auditor_progress_insert",
|
"auditor_progress_insert",
|
||||||
@ -1396,39 +1377,27 @@ postgres_insert_auditor_progress (void *cls,
|
|||||||
* @param cls the @e cls of this struct with the plugin-specific state
|
* @param cls the @e cls of this struct with the plugin-specific state
|
||||||
* @param session connection to use
|
* @param session connection to use
|
||||||
* @param master_pub master key of the exchange
|
* @param master_pub master key of the exchange
|
||||||
* @param last_reserve_in_serial_id serial ID of the last reserve_in transfer the auditor processed
|
* @param pp where is the auditor in processing
|
||||||
* @param last_reserve_out_serial_id serial ID of the last withdraw the auditor processed
|
|
||||||
* @param last_deposit_serial_id serial ID of the last deposit the auditor processed
|
|
||||||
* @param last_melt_serial_id serial ID of the last refresh the auditor processed
|
|
||||||
* @param last_prewire_serial_id serial ID of the last prewire transfer the auditor processed
|
|
||||||
* @return #GNUNET_OK on success; #GNUNET_SYSERR on failure
|
* @return #GNUNET_OK on success; #GNUNET_SYSERR on failure
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
postgres_update_auditor_progress (void *cls,
|
postgres_update_auditor_progress (void *cls,
|
||||||
struct TALER_AUDITORDB_Session *session,
|
struct TALER_AUDITORDB_Session *session,
|
||||||
const struct TALER_MasterPublicKeyP *master_pub,
|
const struct TALER_MasterPublicKeyP *master_pub,
|
||||||
uint64_t last_reserve_in_serial_id,
|
const struct TALER_AUDITORDB_ProgressPoint *pp)
|
||||||
uint64_t last_reserve_out_serial_id,
|
|
||||||
uint64_t last_deposit_serial_id,
|
|
||||||
uint64_t last_melt_serial_id,
|
|
||||||
uint64_t last_refund_serial_id,
|
|
||||||
uint64_t last_prewire_serial_id)
|
|
||||||
{
|
{
|
||||||
PGresult *result;
|
PGresult *result;
|
||||||
int ret;
|
|
||||||
|
|
||||||
struct GNUNET_PQ_QueryParam params[] = {
|
struct GNUNET_PQ_QueryParam params[] = {
|
||||||
GNUNET_PQ_query_param_uint64 (&last_reserve_in_serial_id),
|
GNUNET_PQ_query_param_uint64 (&pp->last_reserve_in_serial_id),
|
||||||
GNUNET_PQ_query_param_uint64 (&last_reserve_out_serial_id),
|
GNUNET_PQ_query_param_uint64 (&pp->last_reserve_out_serial_id),
|
||||||
GNUNET_PQ_query_param_uint64 (&last_deposit_serial_id),
|
GNUNET_PQ_query_param_uint64 (&pp->last_deposit_serial_id),
|
||||||
GNUNET_PQ_query_param_uint64 (&last_melt_serial_id),
|
GNUNET_PQ_query_param_uint64 (&pp->last_melt_serial_id),
|
||||||
GNUNET_PQ_query_param_uint64 (&last_refund_serial_id),
|
GNUNET_PQ_query_param_uint64 (&pp->last_refund_serial_id),
|
||||||
GNUNET_PQ_query_param_uint64 (&last_prewire_serial_id),
|
GNUNET_PQ_query_param_uint64 (&pp->last_prewire_serial_id),
|
||||||
|
|
||||||
GNUNET_PQ_query_param_auto_from_type (master_pub),
|
GNUNET_PQ_query_param_auto_from_type (master_pub),
|
||||||
|
|
||||||
GNUNET_PQ_query_param_end
|
GNUNET_PQ_query_param_end
|
||||||
};
|
};
|
||||||
|
int ret;
|
||||||
|
|
||||||
result = GNUNET_PQ_exec_prepared (session->conn,
|
result = GNUNET_PQ_exec_prepared (session->conn,
|
||||||
"auditor_progress_update",
|
"auditor_progress_update",
|
||||||
@ -1453,11 +1422,7 @@ postgres_update_auditor_progress (void *cls,
|
|||||||
* @param cls the @e cls of this struct with the plugin-specific state
|
* @param cls the @e cls of this struct with the plugin-specific state
|
||||||
* @param session connection to use
|
* @param session connection to use
|
||||||
* @param master_pub master key of the exchange
|
* @param master_pub master key of the exchange
|
||||||
* @param[out] last_reserve_in_serial_id serial ID of the last reserve_in transfer the auditor processed
|
* @param[out] pp set to where the auditor is in processing
|
||||||
* @param[out] last_reserve_out_serial_id serial ID of the last withdraw the auditor processed
|
|
||||||
* @param[out] last_deposit_serial_id serial ID of the last deposit the auditor processed
|
|
||||||
* @param[out] last_melt_serial_id serial ID of the last refresh the auditor processed
|
|
||||||
* @param[out] last_prewire_serial_id serial ID of the last prewire transfer the auditor processed
|
|
||||||
* @return #GNUNET_OK on success; #GNUNET_SYSERR on failure;
|
* @return #GNUNET_OK on success; #GNUNET_SYSERR on failure;
|
||||||
* #GNUNET_NO if we have no records for the @a master_pub
|
* #GNUNET_NO if we have no records for the @a master_pub
|
||||||
*/
|
*/
|
||||||
@ -1465,19 +1430,23 @@ int
|
|||||||
postgres_get_auditor_progress (void *cls,
|
postgres_get_auditor_progress (void *cls,
|
||||||
struct TALER_AUDITORDB_Session *session,
|
struct TALER_AUDITORDB_Session *session,
|
||||||
const struct TALER_MasterPublicKeyP *master_pub,
|
const struct TALER_MasterPublicKeyP *master_pub,
|
||||||
uint64_t *last_reserve_in_serial_id,
|
struct TALER_AUDITORDB_ProgressPoint *pp)
|
||||||
uint64_t *last_reserve_out_serial_id,
|
|
||||||
uint64_t *last_deposit_serial_id,
|
|
||||||
uint64_t *last_melt_serial_id,
|
|
||||||
uint64_t *last_refund_serial_id,
|
|
||||||
uint64_t *last_prewire_serial_id)
|
|
||||||
{
|
{
|
||||||
struct GNUNET_PQ_QueryParam params[] = {
|
struct GNUNET_PQ_QueryParam params[] = {
|
||||||
GNUNET_PQ_query_param_auto_from_type (master_pub),
|
GNUNET_PQ_query_param_auto_from_type (master_pub),
|
||||||
|
|
||||||
GNUNET_PQ_query_param_end
|
GNUNET_PQ_query_param_end
|
||||||
};
|
};
|
||||||
PGresult *result;
|
PGresult *result;
|
||||||
|
struct GNUNET_PQ_ResultSpec rs[] = {
|
||||||
|
GNUNET_PQ_result_spec_uint64 ("last_reserve_in_serial_id", &pp->last_reserve_in_serial_id),
|
||||||
|
GNUNET_PQ_result_spec_uint64 ("last_reserve_out_serial_id", &pp->last_reserve_out_serial_id),
|
||||||
|
GNUNET_PQ_result_spec_uint64 ("last_deposit_serial_id", &pp->last_deposit_serial_id),
|
||||||
|
GNUNET_PQ_result_spec_uint64 ("last_melt_serial_id", &pp->last_melt_serial_id),
|
||||||
|
GNUNET_PQ_result_spec_uint64 ("last_refund_serial_id", &pp->last_refund_serial_id),
|
||||||
|
GNUNET_PQ_result_spec_uint64 ("last_prewire_serial_id", &pp->last_prewire_serial_id),
|
||||||
|
GNUNET_PQ_result_spec_end
|
||||||
|
};
|
||||||
|
|
||||||
result = GNUNET_PQ_exec_prepared (session->conn,
|
result = GNUNET_PQ_exec_prepared (session->conn,
|
||||||
"auditor_progress_select",
|
"auditor_progress_select",
|
||||||
params);
|
params);
|
||||||
@ -1499,18 +1468,10 @@ postgres_get_auditor_progress (void *cls,
|
|||||||
}
|
}
|
||||||
GNUNET_assert (1 == nrows);
|
GNUNET_assert (1 == nrows);
|
||||||
|
|
||||||
struct GNUNET_PQ_ResultSpec rs[] = {
|
|
||||||
GNUNET_PQ_result_spec_uint64 ("last_reserve_in_serial_id", last_reserve_in_serial_id),
|
|
||||||
GNUNET_PQ_result_spec_uint64 ("last_reserve_out_serial_id", last_reserve_out_serial_id),
|
|
||||||
GNUNET_PQ_result_spec_uint64 ("last_deposit_serial_id", last_deposit_serial_id),
|
|
||||||
GNUNET_PQ_result_spec_uint64 ("last_melt_serial_id", last_melt_serial_id),
|
|
||||||
GNUNET_PQ_result_spec_uint64 ("last_refund_serial_id", last_refund_serial_id),
|
|
||||||
GNUNET_PQ_result_spec_uint64 ("last_prewire_serial_id", last_prewire_serial_id),
|
|
||||||
|
|
||||||
GNUNET_PQ_result_spec_end
|
|
||||||
};
|
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
GNUNET_PQ_extract_result (result, rs, 0))
|
GNUNET_PQ_extract_result (result,
|
||||||
|
rs,
|
||||||
|
0))
|
||||||
{
|
{
|
||||||
GNUNET_break (0);
|
GNUNET_break (0);
|
||||||
PQclear (result);
|
PQclear (result);
|
||||||
@ -1552,19 +1513,14 @@ postgres_insert_reserve_info (void *cls,
|
|||||||
{
|
{
|
||||||
PGresult *result;
|
PGresult *result;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
struct GNUNET_PQ_QueryParam params[] = {
|
struct GNUNET_PQ_QueryParam params[] = {
|
||||||
GNUNET_PQ_query_param_auto_from_type (reserve_pub),
|
GNUNET_PQ_query_param_auto_from_type (reserve_pub),
|
||||||
GNUNET_PQ_query_param_auto_from_type (master_pub),
|
GNUNET_PQ_query_param_auto_from_type (master_pub),
|
||||||
|
|
||||||
TALER_PQ_query_param_amount (reserve_balance),
|
TALER_PQ_query_param_amount (reserve_balance),
|
||||||
TALER_PQ_query_param_amount (withdraw_fee_balance),
|
TALER_PQ_query_param_amount (withdraw_fee_balance),
|
||||||
|
|
||||||
GNUNET_PQ_query_param_auto_from_type (&expiration_date),
|
GNUNET_PQ_query_param_auto_from_type (&expiration_date),
|
||||||
|
|
||||||
GNUNET_PQ_query_param_uint64 (&last_reserve_in_serial_id),
|
GNUNET_PQ_query_param_uint64 (&last_reserve_in_serial_id),
|
||||||
GNUNET_PQ_query_param_uint64 (&last_reserve_out_serial_id),
|
GNUNET_PQ_query_param_uint64 (&last_reserve_out_serial_id),
|
||||||
|
|
||||||
GNUNET_PQ_query_param_end
|
GNUNET_PQ_query_param_end
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -1620,19 +1576,14 @@ postgres_update_reserve_info (void *cls,
|
|||||||
{
|
{
|
||||||
PGresult *result;
|
PGresult *result;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
struct GNUNET_PQ_QueryParam params[] = {
|
struct GNUNET_PQ_QueryParam params[] = {
|
||||||
TALER_PQ_query_param_amount (reserve_balance),
|
TALER_PQ_query_param_amount (reserve_balance),
|
||||||
TALER_PQ_query_param_amount (withdraw_fee_balance),
|
TALER_PQ_query_param_amount (withdraw_fee_balance),
|
||||||
|
|
||||||
GNUNET_PQ_query_param_auto_from_type (&expiration_date),
|
GNUNET_PQ_query_param_auto_from_type (&expiration_date),
|
||||||
|
|
||||||
GNUNET_PQ_query_param_uint64 (&last_reserve_in_serial_id),
|
GNUNET_PQ_query_param_uint64 (&last_reserve_in_serial_id),
|
||||||
GNUNET_PQ_query_param_uint64 (&last_reserve_out_serial_id),
|
GNUNET_PQ_query_param_uint64 (&last_reserve_out_serial_id),
|
||||||
|
|
||||||
GNUNET_PQ_query_param_auto_from_type (reserve_pub),
|
GNUNET_PQ_query_param_auto_from_type (reserve_pub),
|
||||||
GNUNET_PQ_query_param_auto_from_type (master_pub),
|
GNUNET_PQ_query_param_auto_from_type (master_pub),
|
||||||
|
|
||||||
GNUNET_PQ_query_param_end
|
GNUNET_PQ_query_param_end
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -1730,7 +1681,6 @@ postgres_get_reserve_info (void *cls,
|
|||||||
struct GNUNET_PQ_QueryParam params[] = {
|
struct GNUNET_PQ_QueryParam params[] = {
|
||||||
GNUNET_PQ_query_param_auto_from_type (reserve_pub),
|
GNUNET_PQ_query_param_auto_from_type (reserve_pub),
|
||||||
GNUNET_PQ_query_param_auto_from_type (master_pub),
|
GNUNET_PQ_query_param_auto_from_type (master_pub),
|
||||||
|
|
||||||
GNUNET_PQ_query_param_end
|
GNUNET_PQ_query_param_end
|
||||||
};
|
};
|
||||||
PGresult *result;
|
PGresult *result;
|
||||||
@ -1799,13 +1749,10 @@ postgres_insert_reserve_summary (void *cls,
|
|||||||
{
|
{
|
||||||
PGresult *result;
|
PGresult *result;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
struct GNUNET_PQ_QueryParam params[] = {
|
struct GNUNET_PQ_QueryParam params[] = {
|
||||||
GNUNET_PQ_query_param_auto_from_type (master_pub),
|
GNUNET_PQ_query_param_auto_from_type (master_pub),
|
||||||
|
|
||||||
TALER_PQ_query_param_amount (reserve_balance),
|
TALER_PQ_query_param_amount (reserve_balance),
|
||||||
TALER_PQ_query_param_amount (withdraw_fee_balance),
|
TALER_PQ_query_param_amount (withdraw_fee_balance),
|
||||||
|
|
||||||
GNUNET_PQ_query_param_end
|
GNUNET_PQ_query_param_end
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -1851,13 +1798,10 @@ postgres_update_reserve_summary (void *cls,
|
|||||||
{
|
{
|
||||||
PGresult *result;
|
PGresult *result;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
struct GNUNET_PQ_QueryParam params[] = {
|
struct GNUNET_PQ_QueryParam params[] = {
|
||||||
TALER_PQ_query_param_amount (reserve_balance),
|
TALER_PQ_query_param_amount (reserve_balance),
|
||||||
TALER_PQ_query_param_amount (withdraw_fee_balance),
|
TALER_PQ_query_param_amount (withdraw_fee_balance),
|
||||||
|
|
||||||
GNUNET_PQ_query_param_auto_from_type (master_pub),
|
GNUNET_PQ_query_param_auto_from_type (master_pub),
|
||||||
|
|
||||||
GNUNET_PQ_query_param_end
|
GNUNET_PQ_query_param_end
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -1899,7 +1843,6 @@ postgres_get_reserve_summary (void *cls,
|
|||||||
{
|
{
|
||||||
struct GNUNET_PQ_QueryParam params[] = {
|
struct GNUNET_PQ_QueryParam params[] = {
|
||||||
GNUNET_PQ_query_param_auto_from_type (master_pub),
|
GNUNET_PQ_query_param_auto_from_type (master_pub),
|
||||||
|
|
||||||
GNUNET_PQ_query_param_end
|
GNUNET_PQ_query_param_end
|
||||||
};
|
};
|
||||||
PGresult *result;
|
PGresult *result;
|
||||||
@ -1978,20 +1921,16 @@ postgres_insert_denomination_balance (void *cls,
|
|||||||
{
|
{
|
||||||
PGresult *result;
|
PGresult *result;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
struct GNUNET_PQ_QueryParam params[] = {
|
struct GNUNET_PQ_QueryParam params[] = {
|
||||||
GNUNET_PQ_query_param_auto_from_type (denom_pub_hash),
|
GNUNET_PQ_query_param_auto_from_type (denom_pub_hash),
|
||||||
|
|
||||||
TALER_PQ_query_param_amount (denom_balance),
|
TALER_PQ_query_param_amount (denom_balance),
|
||||||
TALER_PQ_query_param_amount (deposit_fee_balance),
|
TALER_PQ_query_param_amount (deposit_fee_balance),
|
||||||
TALER_PQ_query_param_amount (melt_fee_balance),
|
TALER_PQ_query_param_amount (melt_fee_balance),
|
||||||
TALER_PQ_query_param_amount (refund_fee_balance),
|
TALER_PQ_query_param_amount (refund_fee_balance),
|
||||||
|
|
||||||
GNUNET_PQ_query_param_uint64 (&last_reserve_out_serial_id),
|
GNUNET_PQ_query_param_uint64 (&last_reserve_out_serial_id),
|
||||||
GNUNET_PQ_query_param_uint64 (&last_deposit_serial_id),
|
GNUNET_PQ_query_param_uint64 (&last_deposit_serial_id),
|
||||||
GNUNET_PQ_query_param_uint64 (&last_melt_serial_id),
|
GNUNET_PQ_query_param_uint64 (&last_melt_serial_id),
|
||||||
GNUNET_PQ_query_param_uint64 (&last_refund_serial_id),
|
GNUNET_PQ_query_param_uint64 (&last_refund_serial_id),
|
||||||
|
|
||||||
GNUNET_PQ_query_param_end
|
GNUNET_PQ_query_param_end
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -2060,20 +1999,16 @@ postgres_update_denomination_balance (void *cls,
|
|||||||
{
|
{
|
||||||
PGresult *result;
|
PGresult *result;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
struct GNUNET_PQ_QueryParam params[] = {
|
struct GNUNET_PQ_QueryParam params[] = {
|
||||||
TALER_PQ_query_param_amount (denom_balance),
|
TALER_PQ_query_param_amount (denom_balance),
|
||||||
TALER_PQ_query_param_amount (deposit_fee_balance),
|
TALER_PQ_query_param_amount (deposit_fee_balance),
|
||||||
TALER_PQ_query_param_amount (melt_fee_balance),
|
TALER_PQ_query_param_amount (melt_fee_balance),
|
||||||
TALER_PQ_query_param_amount (refund_fee_balance),
|
TALER_PQ_query_param_amount (refund_fee_balance),
|
||||||
|
|
||||||
GNUNET_PQ_query_param_uint64 (&last_reserve_out_serial_id),
|
GNUNET_PQ_query_param_uint64 (&last_reserve_out_serial_id),
|
||||||
GNUNET_PQ_query_param_uint64 (&last_deposit_serial_id),
|
GNUNET_PQ_query_param_uint64 (&last_deposit_serial_id),
|
||||||
GNUNET_PQ_query_param_uint64 (&last_melt_serial_id),
|
GNUNET_PQ_query_param_uint64 (&last_melt_serial_id),
|
||||||
GNUNET_PQ_query_param_uint64 (&last_refund_serial_id),
|
GNUNET_PQ_query_param_uint64 (&last_refund_serial_id),
|
||||||
|
|
||||||
GNUNET_PQ_query_param_auto_from_type (denom_pub_hash),
|
GNUNET_PQ_query_param_auto_from_type (denom_pub_hash),
|
||||||
|
|
||||||
GNUNET_PQ_query_param_end
|
GNUNET_PQ_query_param_end
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -2129,10 +2064,10 @@ postgres_get_denomination_balance (void *cls,
|
|||||||
{
|
{
|
||||||
struct GNUNET_PQ_QueryParam params[] = {
|
struct GNUNET_PQ_QueryParam params[] = {
|
||||||
GNUNET_PQ_query_param_auto_from_type (denom_pub_hash),
|
GNUNET_PQ_query_param_auto_from_type (denom_pub_hash),
|
||||||
|
|
||||||
GNUNET_PQ_query_param_end
|
GNUNET_PQ_query_param_end
|
||||||
};
|
};
|
||||||
PGresult *result;
|
PGresult *result;
|
||||||
|
|
||||||
result = GNUNET_PQ_exec_prepared (session->conn,
|
result = GNUNET_PQ_exec_prepared (session->conn,
|
||||||
"denomination_pending_select",
|
"denomination_pending_select",
|
||||||
params);
|
params);
|
||||||
@ -2203,15 +2138,12 @@ postgres_insert_denomination_summary (void *cls,
|
|||||||
{
|
{
|
||||||
PGresult *result;
|
PGresult *result;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
struct GNUNET_PQ_QueryParam params[] = {
|
struct GNUNET_PQ_QueryParam params[] = {
|
||||||
GNUNET_PQ_query_param_auto_from_type (master_pub),
|
GNUNET_PQ_query_param_auto_from_type (master_pub),
|
||||||
|
|
||||||
TALER_PQ_query_param_amount (denom_balance),
|
TALER_PQ_query_param_amount (denom_balance),
|
||||||
TALER_PQ_query_param_amount (deposit_fee_balance),
|
TALER_PQ_query_param_amount (deposit_fee_balance),
|
||||||
TALER_PQ_query_param_amount (melt_fee_balance),
|
TALER_PQ_query_param_amount (melt_fee_balance),
|
||||||
TALER_PQ_query_param_amount (refund_fee_balance),
|
TALER_PQ_query_param_amount (refund_fee_balance),
|
||||||
|
|
||||||
GNUNET_PQ_query_param_end
|
GNUNET_PQ_query_param_end
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -2268,15 +2200,12 @@ postgres_update_denomination_summary (void *cls,
|
|||||||
{
|
{
|
||||||
PGresult *result;
|
PGresult *result;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
struct GNUNET_PQ_QueryParam params[] = {
|
struct GNUNET_PQ_QueryParam params[] = {
|
||||||
TALER_PQ_query_param_amount (denom_balance),
|
TALER_PQ_query_param_amount (denom_balance),
|
||||||
TALER_PQ_query_param_amount (deposit_fee_balance),
|
TALER_PQ_query_param_amount (deposit_fee_balance),
|
||||||
TALER_PQ_query_param_amount (melt_fee_balance),
|
TALER_PQ_query_param_amount (melt_fee_balance),
|
||||||
TALER_PQ_query_param_amount (refund_fee_balance),
|
TALER_PQ_query_param_amount (refund_fee_balance),
|
||||||
|
|
||||||
GNUNET_PQ_query_param_auto_from_type (master_pub),
|
GNUNET_PQ_query_param_auto_from_type (master_pub),
|
||||||
|
|
||||||
GNUNET_PQ_query_param_end
|
GNUNET_PQ_query_param_end
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -2321,10 +2250,10 @@ postgres_get_denomination_summary (void *cls,
|
|||||||
{
|
{
|
||||||
struct GNUNET_PQ_QueryParam params[] = {
|
struct GNUNET_PQ_QueryParam params[] = {
|
||||||
GNUNET_PQ_query_param_auto_from_type (master_pub),
|
GNUNET_PQ_query_param_auto_from_type (master_pub),
|
||||||
|
|
||||||
GNUNET_PQ_query_param_end
|
GNUNET_PQ_query_param_end
|
||||||
};
|
};
|
||||||
PGresult *result;
|
PGresult *result;
|
||||||
|
|
||||||
result = GNUNET_PQ_exec_prepared (session->conn,
|
result = GNUNET_PQ_exec_prepared (session->conn,
|
||||||
"total_liabilities_select",
|
"total_liabilities_select",
|
||||||
params);
|
params);
|
||||||
@ -2384,12 +2313,9 @@ postgres_insert_risk_summary (void *cls,
|
|||||||
{
|
{
|
||||||
PGresult *result;
|
PGresult *result;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
struct GNUNET_PQ_QueryParam params[] = {
|
struct GNUNET_PQ_QueryParam params[] = {
|
||||||
GNUNET_PQ_query_param_auto_from_type (master_pub),
|
GNUNET_PQ_query_param_auto_from_type (master_pub),
|
||||||
|
|
||||||
TALER_PQ_query_param_amount (risk),
|
TALER_PQ_query_param_amount (risk),
|
||||||
|
|
||||||
GNUNET_PQ_query_param_end
|
GNUNET_PQ_query_param_end
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -2428,12 +2354,9 @@ postgres_update_risk_summary (void *cls,
|
|||||||
{
|
{
|
||||||
PGresult *result;
|
PGresult *result;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
struct GNUNET_PQ_QueryParam params[] = {
|
struct GNUNET_PQ_QueryParam params[] = {
|
||||||
TALER_PQ_query_param_amount (risk),
|
TALER_PQ_query_param_amount (risk),
|
||||||
|
|
||||||
GNUNET_PQ_query_param_auto_from_type (master_pub),
|
GNUNET_PQ_query_param_auto_from_type (master_pub),
|
||||||
|
|
||||||
GNUNET_PQ_query_param_end
|
GNUNET_PQ_query_param_end
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -2472,10 +2395,10 @@ postgres_get_risk_summary (void *cls,
|
|||||||
{
|
{
|
||||||
struct GNUNET_PQ_QueryParam params[] = {
|
struct GNUNET_PQ_QueryParam params[] = {
|
||||||
GNUNET_PQ_query_param_auto_from_type (master_pub),
|
GNUNET_PQ_query_param_auto_from_type (master_pub),
|
||||||
|
|
||||||
GNUNET_PQ_query_param_end
|
GNUNET_PQ_query_param_end
|
||||||
};
|
};
|
||||||
PGresult *result;
|
PGresult *result;
|
||||||
|
|
||||||
result = GNUNET_PQ_exec_prepared (session->conn,
|
result = GNUNET_PQ_exec_prepared (session->conn,
|
||||||
"total_risk_select",
|
"total_risk_select",
|
||||||
params);
|
params);
|
||||||
@ -2544,18 +2467,14 @@ postgres_insert_historic_denom_revenue (void *cls,
|
|||||||
{
|
{
|
||||||
PGresult *result;
|
PGresult *result;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
struct GNUNET_PQ_QueryParam params[] = {
|
struct GNUNET_PQ_QueryParam params[] = {
|
||||||
GNUNET_PQ_query_param_auto_from_type (master_pub),
|
GNUNET_PQ_query_param_auto_from_type (master_pub),
|
||||||
GNUNET_PQ_query_param_auto_from_type (denom_pub_hash),
|
GNUNET_PQ_query_param_auto_from_type (denom_pub_hash),
|
||||||
|
|
||||||
GNUNET_PQ_query_param_auto_from_type (&revenue_timestamp),
|
GNUNET_PQ_query_param_auto_from_type (&revenue_timestamp),
|
||||||
|
|
||||||
TALER_PQ_query_param_amount (revenue_balance),
|
TALER_PQ_query_param_amount (revenue_balance),
|
||||||
TALER_PQ_query_param_amount (deposit_fee_balance),
|
TALER_PQ_query_param_amount (deposit_fee_balance),
|
||||||
TALER_PQ_query_param_amount (melt_fee_balance),
|
TALER_PQ_query_param_amount (melt_fee_balance),
|
||||||
TALER_PQ_query_param_amount (refund_fee_balance),
|
TALER_PQ_query_param_amount (refund_fee_balance),
|
||||||
|
|
||||||
GNUNET_PQ_query_param_end
|
GNUNET_PQ_query_param_end
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -2608,10 +2527,10 @@ postgres_select_historic_denom_revenue (void *cls,
|
|||||||
{
|
{
|
||||||
struct GNUNET_PQ_QueryParam params[] = {
|
struct GNUNET_PQ_QueryParam params[] = {
|
||||||
GNUNET_PQ_query_param_auto_from_type (master_pub),
|
GNUNET_PQ_query_param_auto_from_type (master_pub),
|
||||||
|
|
||||||
GNUNET_PQ_query_param_end
|
GNUNET_PQ_query_param_end
|
||||||
};
|
};
|
||||||
PGresult *result;
|
PGresult *result;
|
||||||
|
|
||||||
result = GNUNET_PQ_exec_prepared (session->conn,
|
result = GNUNET_PQ_exec_prepared (session->conn,
|
||||||
"historic_denomination_revenue_select",
|
"historic_denomination_revenue_select",
|
||||||
params);
|
params);
|
||||||
@ -2640,19 +2559,16 @@ postgres_select_historic_denom_revenue (void *cls,
|
|||||||
struct TALER_Amount deposit_fee_balance;
|
struct TALER_Amount deposit_fee_balance;
|
||||||
struct TALER_Amount melt_fee_balance;
|
struct TALER_Amount melt_fee_balance;
|
||||||
struct TALER_Amount refund_fee_balance;
|
struct TALER_Amount refund_fee_balance;
|
||||||
|
|
||||||
struct GNUNET_PQ_ResultSpec rs[] = {
|
struct GNUNET_PQ_ResultSpec rs[] = {
|
||||||
GNUNET_PQ_result_spec_auto_from_type ("denom_pub_hash", &denom_pub_hash),
|
GNUNET_PQ_result_spec_auto_from_type ("denom_pub_hash", &denom_pub_hash),
|
||||||
|
|
||||||
GNUNET_PQ_result_spec_auto_from_type ("revenue_timestamp", &revenue_timestamp),
|
GNUNET_PQ_result_spec_auto_from_type ("revenue_timestamp", &revenue_timestamp),
|
||||||
|
|
||||||
TALER_PQ_result_spec_amount ("revenue_balance", &revenue_balance),
|
TALER_PQ_result_spec_amount ("revenue_balance", &revenue_balance),
|
||||||
TALER_PQ_result_spec_amount ("deposit_fee_balance", &deposit_fee_balance),
|
TALER_PQ_result_spec_amount ("deposit_fee_balance", &deposit_fee_balance),
|
||||||
TALER_PQ_result_spec_amount ("melt_fee_balance", &melt_fee_balance),
|
TALER_PQ_result_spec_amount ("melt_fee_balance", &melt_fee_balance),
|
||||||
TALER_PQ_result_spec_amount ("refund_fee_balance", &refund_fee_balance),
|
TALER_PQ_result_spec_amount ("refund_fee_balance", &refund_fee_balance),
|
||||||
|
|
||||||
GNUNET_PQ_result_spec_end
|
GNUNET_PQ_result_spec_end
|
||||||
};
|
};
|
||||||
|
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
GNUNET_PQ_extract_result (result, rs, 0))
|
GNUNET_PQ_extract_result (result, rs, 0))
|
||||||
{
|
{
|
||||||
@ -2707,15 +2623,11 @@ postgres_insert_historic_losses (void *cls,
|
|||||||
{
|
{
|
||||||
PGresult *result;
|
PGresult *result;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
struct GNUNET_PQ_QueryParam params[] = {
|
struct GNUNET_PQ_QueryParam params[] = {
|
||||||
GNUNET_PQ_query_param_auto_from_type (master_pub),
|
GNUNET_PQ_query_param_auto_from_type (master_pub),
|
||||||
GNUNET_PQ_query_param_auto_from_type (denom_pub_hash),
|
GNUNET_PQ_query_param_auto_from_type (denom_pub_hash),
|
||||||
|
|
||||||
GNUNET_PQ_query_param_auto_from_type (&loss_timestamp),
|
GNUNET_PQ_query_param_auto_from_type (&loss_timestamp),
|
||||||
|
|
||||||
TALER_PQ_query_param_amount (loss_balance),
|
TALER_PQ_query_param_amount (loss_balance),
|
||||||
|
|
||||||
GNUNET_PQ_query_param_end
|
GNUNET_PQ_query_param_end
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -2756,10 +2668,10 @@ postgres_select_historic_losses (void *cls,
|
|||||||
{
|
{
|
||||||
struct GNUNET_PQ_QueryParam params[] = {
|
struct GNUNET_PQ_QueryParam params[] = {
|
||||||
GNUNET_PQ_query_param_auto_from_type (master_pub),
|
GNUNET_PQ_query_param_auto_from_type (master_pub),
|
||||||
|
|
||||||
GNUNET_PQ_query_param_end
|
GNUNET_PQ_query_param_end
|
||||||
};
|
};
|
||||||
PGresult *result;
|
PGresult *result;
|
||||||
|
|
||||||
result = GNUNET_PQ_exec_prepared (session->conn,
|
result = GNUNET_PQ_exec_prepared (session->conn,
|
||||||
"historic_losses_select",
|
"historic_losses_select",
|
||||||
params);
|
params);
|
||||||
@ -2841,15 +2753,11 @@ postgres_insert_historic_reserve_revenue (void *cls,
|
|||||||
{
|
{
|
||||||
PGresult *result;
|
PGresult *result;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
struct GNUNET_PQ_QueryParam params[] = {
|
struct GNUNET_PQ_QueryParam params[] = {
|
||||||
GNUNET_PQ_query_param_auto_from_type (master_pub),
|
GNUNET_PQ_query_param_auto_from_type (master_pub),
|
||||||
|
|
||||||
GNUNET_PQ_query_param_auto_from_type (&start_time),
|
GNUNET_PQ_query_param_auto_from_type (&start_time),
|
||||||
GNUNET_PQ_query_param_auto_from_type (&end_time),
|
GNUNET_PQ_query_param_auto_from_type (&end_time),
|
||||||
|
|
||||||
TALER_PQ_query_param_amount (reserve_profits),
|
TALER_PQ_query_param_amount (reserve_profits),
|
||||||
|
|
||||||
GNUNET_PQ_query_param_end
|
GNUNET_PQ_query_param_end
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -2889,10 +2797,10 @@ postgres_select_historic_reserve_revenue (void *cls,
|
|||||||
{
|
{
|
||||||
struct GNUNET_PQ_QueryParam params[] = {
|
struct GNUNET_PQ_QueryParam params[] = {
|
||||||
GNUNET_PQ_query_param_auto_from_type (master_pub),
|
GNUNET_PQ_query_param_auto_from_type (master_pub),
|
||||||
|
|
||||||
GNUNET_PQ_query_param_end
|
GNUNET_PQ_query_param_end
|
||||||
};
|
};
|
||||||
PGresult *result;
|
PGresult *result;
|
||||||
|
|
||||||
result = GNUNET_PQ_exec_prepared (session->conn,
|
result = GNUNET_PQ_exec_prepared (session->conn,
|
||||||
"historic_reserve_summary_select",
|
"historic_reserve_summary_select",
|
||||||
params);
|
params);
|
||||||
@ -2922,9 +2830,7 @@ postgres_select_historic_reserve_revenue (void *cls,
|
|||||||
struct GNUNET_PQ_ResultSpec rs[] = {
|
struct GNUNET_PQ_ResultSpec rs[] = {
|
||||||
GNUNET_PQ_result_spec_auto_from_type ("start_date", &start_date),
|
GNUNET_PQ_result_spec_auto_from_type ("start_date", &start_date),
|
||||||
GNUNET_PQ_result_spec_auto_from_type ("end_date", &end_date),
|
GNUNET_PQ_result_spec_auto_from_type ("end_date", &end_date),
|
||||||
|
|
||||||
TALER_PQ_result_spec_amount ("reserve_profits", &reserve_profits),
|
TALER_PQ_result_spec_amount ("reserve_profits", &reserve_profits),
|
||||||
|
|
||||||
GNUNET_PQ_result_spec_end
|
GNUNET_PQ_result_spec_end
|
||||||
};
|
};
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
@ -2970,11 +2876,9 @@ postgres_insert_predicted_result (void *cls,
|
|||||||
{
|
{
|
||||||
PGresult *result;
|
PGresult *result;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
struct GNUNET_PQ_QueryParam params[] = {
|
struct GNUNET_PQ_QueryParam params[] = {
|
||||||
GNUNET_PQ_query_param_auto_from_type (master_pub),
|
GNUNET_PQ_query_param_auto_from_type (master_pub),
|
||||||
TALER_PQ_query_param_amount (balance),
|
TALER_PQ_query_param_amount (balance),
|
||||||
|
|
||||||
GNUNET_PQ_query_param_end
|
GNUNET_PQ_query_param_end
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -3017,7 +2921,6 @@ postgres_update_predicted_result (void *cls,
|
|||||||
struct GNUNET_PQ_QueryParam params[] = {
|
struct GNUNET_PQ_QueryParam params[] = {
|
||||||
TALER_PQ_query_param_amount (balance),
|
TALER_PQ_query_param_amount (balance),
|
||||||
GNUNET_PQ_query_param_auto_from_type (master_pub),
|
GNUNET_PQ_query_param_auto_from_type (master_pub),
|
||||||
|
|
||||||
GNUNET_PQ_query_param_end
|
GNUNET_PQ_query_param_end
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -3056,10 +2959,10 @@ postgres_get_predicted_balance (void *cls,
|
|||||||
{
|
{
|
||||||
struct GNUNET_PQ_QueryParam params[] = {
|
struct GNUNET_PQ_QueryParam params[] = {
|
||||||
GNUNET_PQ_query_param_auto_from_type (master_pub),
|
GNUNET_PQ_query_param_auto_from_type (master_pub),
|
||||||
|
|
||||||
GNUNET_PQ_query_param_end
|
GNUNET_PQ_query_param_end
|
||||||
};
|
};
|
||||||
PGresult *result;
|
PGresult *result;
|
||||||
|
|
||||||
result = GNUNET_PQ_exec_prepared (session->conn,
|
result = GNUNET_PQ_exec_prepared (session->conn,
|
||||||
"predicted_result_select",
|
"predicted_result_select",
|
||||||
params);
|
params);
|
||||||
@ -3113,7 +3016,6 @@ libtaler_plugin_auditordb_postgres_init (void *cls)
|
|||||||
const char *ec;
|
const char *ec;
|
||||||
|
|
||||||
pg = GNUNET_new (struct PostgresClosure);
|
pg = GNUNET_new (struct PostgresClosure);
|
||||||
|
|
||||||
if (0 != pthread_key_create (&pg->db_conn_threadlocal,
|
if (0 != pthread_key_create (&pg->db_conn_threadlocal,
|
||||||
&db_conn_destroy))
|
&db_conn_destroy))
|
||||||
{
|
{
|
||||||
|
@ -201,52 +201,43 @@ run (void *cls)
|
|||||||
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
|
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
|
||||||
"Test: insert_auditor_progress\n");
|
"Test: insert_auditor_progress\n");
|
||||||
|
|
||||||
uint64_t
|
struct TALER_AUDITORDB_ProgressPoint pp = {
|
||||||
last_reserve_in_serial_id = 1234,
|
.last_reserve_in_serial_id = 1234,
|
||||||
last_reserve_out_serial_id = 5678,
|
.last_reserve_out_serial_id = 5678,
|
||||||
last_deposit_serial_id = 123,
|
.last_deposit_serial_id = 123,
|
||||||
last_melt_serial_id = 456,
|
.last_melt_serial_id = 456,
|
||||||
last_refund_serial_id = 789,
|
.last_refund_serial_id = 789,
|
||||||
last_prewire_serial_id = 555,
|
.last_prewire_serial_id = 555
|
||||||
|
};
|
||||||
last_reserve_in_serial_id2 = 0,
|
struct TALER_AUDITORDB_ProgressPoint pp2 = {
|
||||||
last_reserve_out_serial_id2 = 0,
|
.last_reserve_in_serial_id = 0,
|
||||||
last_deposit_serial_id2 = 0,
|
.last_reserve_out_serial_id = 0,
|
||||||
last_melt_serial_id2 = 0,
|
.last_deposit_serial_id = 0,
|
||||||
last_refund_serial_id2 = 0,
|
.last_melt_serial_id = 0,
|
||||||
last_prewire_serial_id2 = 0;
|
.last_refund_serial_id = 0,
|
||||||
|
.last_prewire_serial_id = 0
|
||||||
|
};
|
||||||
|
|
||||||
FAILIF (GNUNET_OK !=
|
FAILIF (GNUNET_OK !=
|
||||||
plugin->insert_auditor_progress (plugin->cls,
|
plugin->insert_auditor_progress (plugin->cls,
|
||||||
session,
|
session,
|
||||||
&master_pub,
|
&master_pub,
|
||||||
last_reserve_in_serial_id,
|
&pp));
|
||||||
last_reserve_out_serial_id,
|
|
||||||
last_deposit_serial_id,
|
|
||||||
last_melt_serial_id,
|
|
||||||
last_refund_serial_id,
|
|
||||||
last_prewire_serial_id));
|
|
||||||
|
|
||||||
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
|
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
|
||||||
"Test: update_auditor_progress\n");
|
"Test: update_auditor_progress\n");
|
||||||
|
|
||||||
last_reserve_in_serial_id++;
|
pp.last_reserve_in_serial_id++;
|
||||||
last_reserve_out_serial_id++;
|
pp.last_reserve_out_serial_id++;
|
||||||
last_deposit_serial_id2++;
|
pp.last_deposit_serial_id++;
|
||||||
last_melt_serial_id2++;
|
pp.last_melt_serial_id++;
|
||||||
last_refund_serial_id2++;
|
pp.last_refund_serial_id++;
|
||||||
last_prewire_serial_id2++;
|
pp.last_prewire_serial_id++;
|
||||||
|
|
||||||
FAILIF (GNUNET_OK !=
|
FAILIF (GNUNET_OK !=
|
||||||
plugin->update_auditor_progress (plugin->cls,
|
plugin->update_auditor_progress (plugin->cls,
|
||||||
session,
|
session,
|
||||||
&master_pub,
|
&master_pub,
|
||||||
last_reserve_in_serial_id,
|
&pp));
|
||||||
last_reserve_out_serial_id,
|
|
||||||
last_deposit_serial_id,
|
|
||||||
last_melt_serial_id,
|
|
||||||
last_refund_serial_id,
|
|
||||||
last_prewire_serial_id));
|
|
||||||
|
|
||||||
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
|
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
|
||||||
"Test: get_auditor_progress\n");
|
"Test: get_auditor_progress\n");
|
||||||
@ -255,19 +246,13 @@ run (void *cls)
|
|||||||
plugin->get_auditor_progress (plugin->cls,
|
plugin->get_auditor_progress (plugin->cls,
|
||||||
session,
|
session,
|
||||||
&master_pub,
|
&master_pub,
|
||||||
&last_reserve_in_serial_id2,
|
&pp2));
|
||||||
&last_reserve_out_serial_id2,
|
FAILIF ( (pp.last_reserve_in_serial_id != pp2.last_reserve_in_serial_id) ||
|
||||||
&last_deposit_serial_id2,
|
(pp.last_reserve_out_serial_id != pp2.last_reserve_out_serial_id) ||
|
||||||
&last_melt_serial_id2,
|
(pp.last_deposit_serial_id != pp2.last_deposit_serial_id) ||
|
||||||
&last_refund_serial_id2,
|
(pp.last_melt_serial_id != pp2.last_melt_serial_id) ||
|
||||||
&last_prewire_serial_id2));
|
(pp.last_refund_serial_id != pp2.last_refund_serial_id) ||
|
||||||
|
(pp.last_prewire_serial_id != pp2.last_prewire_serial_id) );
|
||||||
FAILIF (last_reserve_in_serial_id2 != last_reserve_in_serial_id
|
|
||||||
|| last_reserve_out_serial_id2 != last_reserve_out_serial_id
|
|
||||||
|| last_deposit_serial_id2 != last_deposit_serial_id
|
|
||||||
|| last_melt_serial_id2 != last_melt_serial_id
|
|
||||||
|| last_refund_serial_id2 != last_refund_serial_id
|
|
||||||
|| last_prewire_serial_id2 != last_prewire_serial_id);
|
|
||||||
|
|
||||||
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
|
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
|
||||||
"Test: insert_reserve_info\n");
|
"Test: insert_reserve_info\n");
|
||||||
@ -290,14 +275,14 @@ run (void *cls)
|
|||||||
&reserve_balance,
|
&reserve_balance,
|
||||||
&withdraw_fee_balance,
|
&withdraw_fee_balance,
|
||||||
past,
|
past,
|
||||||
last_reserve_in_serial_id,
|
pp.last_reserve_in_serial_id,
|
||||||
last_reserve_out_serial_id));
|
pp.last_reserve_out_serial_id));
|
||||||
|
|
||||||
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
|
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
|
||||||
"Test: update_reserve_info\n");
|
"Test: update_reserve_info\n");
|
||||||
|
|
||||||
last_reserve_in_serial_id++;
|
pp.last_reserve_in_serial_id++;
|
||||||
last_reserve_out_serial_id++;
|
pp.last_reserve_out_serial_id++;
|
||||||
|
|
||||||
FAILIF (GNUNET_OK !=
|
FAILIF (GNUNET_OK !=
|
||||||
plugin->update_reserve_info (plugin->cls,
|
plugin->update_reserve_info (plugin->cls,
|
||||||
@ -307,8 +292,8 @@ run (void *cls)
|
|||||||
&reserve_balance,
|
&reserve_balance,
|
||||||
&withdraw_fee_balance,
|
&withdraw_fee_balance,
|
||||||
future,
|
future,
|
||||||
last_reserve_in_serial_id,
|
pp.last_reserve_in_serial_id,
|
||||||
last_reserve_out_serial_id));
|
pp.last_reserve_out_serial_id));
|
||||||
|
|
||||||
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
|
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
|
||||||
"Test: get_reserve_info\n");
|
"Test: get_reserve_info\n");
|
||||||
@ -321,14 +306,14 @@ run (void *cls)
|
|||||||
&reserve_balance2,
|
&reserve_balance2,
|
||||||
&withdraw_fee_balance2,
|
&withdraw_fee_balance2,
|
||||||
&date,
|
&date,
|
||||||
&last_reserve_in_serial_id2,
|
&pp2.last_reserve_in_serial_id,
|
||||||
&last_reserve_out_serial_id2));
|
&pp2.last_reserve_out_serial_id));
|
||||||
|
|
||||||
FAILIF (0 != memcmp (&date, &future, sizeof (future))
|
FAILIF (0 != memcmp (&date, &future, sizeof (future))
|
||||||
|| 0 != memcmp (&reserve_balance2, &reserve_balance, sizeof (reserve_balance))
|
|| 0 != memcmp (&reserve_balance2, &reserve_balance, sizeof (reserve_balance))
|
||||||
|| 0 != memcmp (&withdraw_fee_balance2, &withdraw_fee_balance, sizeof (withdraw_fee_balance))
|
|| 0 != memcmp (&withdraw_fee_balance2, &withdraw_fee_balance, sizeof (withdraw_fee_balance))
|
||||||
|| last_reserve_in_serial_id2 != last_reserve_in_serial_id
|
|| pp2.last_reserve_in_serial_id != pp.last_reserve_in_serial_id
|
||||||
|| last_reserve_out_serial_id2 != last_reserve_out_serial_id);
|
|| pp2.last_reserve_out_serial_id != pp.last_reserve_out_serial_id);
|
||||||
|
|
||||||
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
|
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
|
||||||
"Test: insert_reserve_summary\n");
|
"Test: insert_reserve_summary\n");
|
||||||
@ -393,18 +378,18 @@ run (void *cls)
|
|||||||
&melt_fee_balance,
|
&melt_fee_balance,
|
||||||
&deposit_fee_balance,
|
&deposit_fee_balance,
|
||||||
&denom_balance,
|
&denom_balance,
|
||||||
last_reserve_out_serial_id,
|
pp.last_reserve_out_serial_id,
|
||||||
last_deposit_serial_id,
|
pp.last_deposit_serial_id,
|
||||||
last_melt_serial_id,
|
pp.last_melt_serial_id,
|
||||||
last_refund_serial_id));
|
pp.last_refund_serial_id));
|
||||||
|
|
||||||
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
|
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
|
||||||
"Test: update_denomination_balance\n");
|
"Test: update_denomination_balance\n");
|
||||||
|
|
||||||
last_reserve_out_serial_id++;
|
pp.last_reserve_out_serial_id++;
|
||||||
last_deposit_serial_id++;
|
pp.last_deposit_serial_id++;
|
||||||
last_melt_serial_id++;
|
pp.last_melt_serial_id++;
|
||||||
last_refund_serial_id++;
|
pp.last_refund_serial_id++;
|
||||||
|
|
||||||
FAILIF (GNUNET_OK !=
|
FAILIF (GNUNET_OK !=
|
||||||
plugin->update_denomination_balance (plugin->cls,
|
plugin->update_denomination_balance (plugin->cls,
|
||||||
@ -414,10 +399,10 @@ run (void *cls)
|
|||||||
&deposit_fee_balance,
|
&deposit_fee_balance,
|
||||||
&melt_fee_balance,
|
&melt_fee_balance,
|
||||||
&refund_fee_balance,
|
&refund_fee_balance,
|
||||||
last_reserve_out_serial_id,
|
pp.last_reserve_out_serial_id,
|
||||||
last_deposit_serial_id,
|
pp.last_deposit_serial_id,
|
||||||
last_melt_serial_id,
|
pp.last_melt_serial_id,
|
||||||
last_refund_serial_id));
|
pp.last_refund_serial_id));
|
||||||
|
|
||||||
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
|
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
|
||||||
"Test: get_denomination_balance\n");
|
"Test: get_denomination_balance\n");
|
||||||
@ -430,19 +415,19 @@ run (void *cls)
|
|||||||
&deposit_fee_balance2,
|
&deposit_fee_balance2,
|
||||||
&melt_fee_balance2,
|
&melt_fee_balance2,
|
||||||
&refund_fee_balance2,
|
&refund_fee_balance2,
|
||||||
&last_reserve_out_serial_id2,
|
&pp2.last_reserve_out_serial_id,
|
||||||
&last_deposit_serial_id2,
|
&pp2.last_deposit_serial_id,
|
||||||
&last_melt_serial_id2,
|
&pp2.last_melt_serial_id,
|
||||||
&last_refund_serial_id2));
|
&pp2.last_refund_serial_id));
|
||||||
|
|
||||||
FAILIF (0 != memcmp (&denom_balance2, &denom_balance, sizeof (denom_balance))
|
FAILIF (0 != memcmp (&denom_balance2, &denom_balance, sizeof (denom_balance))
|
||||||
|| 0 != memcmp (&deposit_fee_balance2, &deposit_fee_balance, sizeof (deposit_fee_balance))
|
|| 0 != memcmp (&deposit_fee_balance2, &deposit_fee_balance, sizeof (deposit_fee_balance))
|
||||||
|| 0 != memcmp (&melt_fee_balance2, &melt_fee_balance, sizeof (melt_fee_balance))
|
|| 0 != memcmp (&melt_fee_balance2, &melt_fee_balance, sizeof (melt_fee_balance))
|
||||||
|| 0 != memcmp (&refund_fee_balance2, &refund_fee_balance, sizeof (refund_fee_balance))
|
|| 0 != memcmp (&refund_fee_balance2, &refund_fee_balance, sizeof (refund_fee_balance))
|
||||||
|| last_reserve_out_serial_id2 != last_reserve_out_serial_id
|
|| pp2.last_reserve_out_serial_id != pp.last_reserve_out_serial_id
|
||||||
|| last_deposit_serial_id2 != last_deposit_serial_id
|
|| pp2.last_deposit_serial_id != pp.last_deposit_serial_id
|
||||||
|| last_melt_serial_id2 != last_melt_serial_id
|
|| pp2.last_melt_serial_id != pp.last_melt_serial_id
|
||||||
|| last_refund_serial_id2 != last_refund_serial_id);
|
|| pp2.last_refund_serial_id != pp.last_refund_serial_id);
|
||||||
|
|
||||||
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
|
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
|
||||||
"Test: insert_denomination_summary\n");
|
"Test: insert_denomination_summary\n");
|
||||||
|
@ -112,6 +112,49 @@ typedef int
|
|||||||
const struct TALER_Amount *reserve_profits);
|
const struct TALER_Amount *reserve_profits);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Structure for remembering the auditor's progress over the
|
||||||
|
* various tables and (auditor) transactions.
|
||||||
|
*/
|
||||||
|
struct TALER_AUDITORDB_ProgressPoint
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* last_reserve_in_serial_id serial ID of the last reserve_in transfer the auditor processed
|
||||||
|
*/
|
||||||
|
uint64_t last_reserve_in_serial_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* last_reserve_out_serial_id serial ID of the last withdraw the auditor processed
|
||||||
|
*/
|
||||||
|
uint64_t last_reserve_out_serial_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* last_deposit_serial_id serial ID of the last deposit the auditor processed
|
||||||
|
*/
|
||||||
|
uint64_t last_deposit_serial_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* last_melt_serial_id serial ID of the last refresh the auditor processed
|
||||||
|
*/
|
||||||
|
uint64_t last_melt_serial_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* last_prewire_serial_id serial ID of the last prewire transfer the auditor processed
|
||||||
|
*/
|
||||||
|
uint64_t last_refund_serial_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* last_prewire_serial_id serial ID of the last prewire transfer the auditor processed
|
||||||
|
*/
|
||||||
|
uint64_t last_prewire_serial_id;
|
||||||
|
|
||||||
|
// FIXME: the above does not quite work, as independent transactions
|
||||||
|
// touch certain tables (i.e. reserves_out), so we need some of
|
||||||
|
// these counters more than once!
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle for one session with the database.
|
* Handle for one session with the database.
|
||||||
*/
|
*/
|
||||||
@ -252,10 +295,6 @@ struct TALER_AUDITORDB_Plugin
|
|||||||
void *cb_cls);
|
void *cb_cls);
|
||||||
|
|
||||||
|
|
||||||
// FIXME: this does not quite work, as independent transactions
|
|
||||||
// touch certain tables (i.e. reserves_out), so we need some of
|
|
||||||
// these counters more than once!
|
|
||||||
// ALSO: put all of these counters into a struct, this is very ugly...
|
|
||||||
/**
|
/**
|
||||||
* Insert information about the auditor's progress with an exchange's
|
* Insert information about the auditor's progress with an exchange's
|
||||||
* data.
|
* data.
|
||||||
@ -263,23 +302,14 @@ struct TALER_AUDITORDB_Plugin
|
|||||||
* @param cls the @e cls of this struct with the plugin-specific state
|
* @param cls the @e cls of this struct with the plugin-specific state
|
||||||
* @param session connection to use
|
* @param session connection to use
|
||||||
* @param master_pub master key of the exchange
|
* @param master_pub master key of the exchange
|
||||||
* @param last_reserve_in_serial_id serial ID of the last reserve_in transfer the auditor processed
|
* @param pp where is the auditor in processing
|
||||||
* @param last_reserve_out_serial_id serial ID of the last withdraw the auditor processed
|
|
||||||
* @param last_deposit_serial_id serial ID of the last deposit the auditor processed
|
|
||||||
* @param last_melt_serial_id serial ID of the last refresh the auditor processed
|
|
||||||
* @param last_prewire_serial_id serial ID of the last prewire transfer the auditor processed
|
|
||||||
* @return #GNUNET_OK on success; #GNUNET_SYSERR on failure
|
* @return #GNUNET_OK on success; #GNUNET_SYSERR on failure
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
(*insert_auditor_progress)(void *cls,
|
(*insert_auditor_progress)(void *cls,
|
||||||
struct TALER_AUDITORDB_Session *session,
|
struct TALER_AUDITORDB_Session *session,
|
||||||
const struct TALER_MasterPublicKeyP *master_pub,
|
const struct TALER_MasterPublicKeyP *master_pub,
|
||||||
uint64_t last_reserve_in_serial_id,
|
const struct TALER_AUDITORDB_ProgressPoint *pp);
|
||||||
uint64_t last_reserve_out_serial_id,
|
|
||||||
uint64_t last_deposit_serial_id,
|
|
||||||
uint64_t last_melt_serial_id,
|
|
||||||
uint64_t last_refund_serial_id,
|
|
||||||
uint64_t last_prewire_serial_id);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -289,23 +319,14 @@ struct TALER_AUDITORDB_Plugin
|
|||||||
* @param cls the @e cls of this struct with the plugin-specific state
|
* @param cls the @e cls of this struct with the plugin-specific state
|
||||||
* @param session connection to use
|
* @param session connection to use
|
||||||
* @param master_pub master key of the exchange
|
* @param master_pub master key of the exchange
|
||||||
* @param last_reserve_in_serial_id serial ID of the last reserve_in transfer the auditor processed
|
* @param pp where is the auditor in processing
|
||||||
* @param last_reserve_out_serial_id serial ID of the last withdraw the auditor processed
|
|
||||||
* @param last_deposit_serial_id serial ID of the last deposit the auditor processed
|
|
||||||
* @param last_melt_serial_id serial ID of the last refresh the auditor processed
|
|
||||||
* @param last_prewire_serial_id serial ID of the last prewire transfer the auditor processed
|
|
||||||
* @return #GNUNET_OK on success; #GNUNET_SYSERR on failure
|
* @return #GNUNET_OK on success; #GNUNET_SYSERR on failure
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
(*update_auditor_progress)(void *cls,
|
(*update_auditor_progress)(void *cls,
|
||||||
struct TALER_AUDITORDB_Session *session,
|
struct TALER_AUDITORDB_Session *session,
|
||||||
const struct TALER_MasterPublicKeyP *master_pub,
|
const struct TALER_MasterPublicKeyP *master_pub,
|
||||||
uint64_t last_reserve_in_serial_id,
|
const struct TALER_AUDITORDB_ProgressPoint *pp);
|
||||||
uint64_t last_reserve_out_serial_id,
|
|
||||||
uint64_t last_deposit_serial_id,
|
|
||||||
uint64_t last_melt_serial_id,
|
|
||||||
uint64_t last_refund_serial_id,
|
|
||||||
uint64_t last_prewire_serial_id);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -314,11 +335,7 @@ struct TALER_AUDITORDB_Plugin
|
|||||||
* @param cls the @e cls of this struct with the plugin-specific state
|
* @param cls the @e cls of this struct with the plugin-specific state
|
||||||
* @param session connection to use
|
* @param session connection to use
|
||||||
* @param master_pub master key of the exchange
|
* @param master_pub master key of the exchange
|
||||||
* @param[out] last_reserve_in_serial_id serial ID of the last reserve_in transfer the auditor processed
|
* @param[out] pp set to where the auditor is in processing
|
||||||
* @param[out] last_reserve_out_serial_id serial ID of the last withdraw the auditor processed
|
|
||||||
* @param[out] last_deposit_serial_id serial ID of the last deposit the auditor processed
|
|
||||||
* @param[out] last_melt_serial_id serial ID of the last refresh the auditor processed
|
|
||||||
* @param[out] last_prewire_serial_id serial ID of the last prewire transfer the auditor processed
|
|
||||||
* @return #GNUNET_OK on success; #GNUNET_SYSERR on failure;
|
* @return #GNUNET_OK on success; #GNUNET_SYSERR on failure;
|
||||||
* #GNUNET_NO if we have no records for the @a master_pub
|
* #GNUNET_NO if we have no records for the @a master_pub
|
||||||
*/
|
*/
|
||||||
@ -326,12 +343,7 @@ struct TALER_AUDITORDB_Plugin
|
|||||||
(*get_auditor_progress)(void *cls,
|
(*get_auditor_progress)(void *cls,
|
||||||
struct TALER_AUDITORDB_Session *session,
|
struct TALER_AUDITORDB_Session *session,
|
||||||
const struct TALER_MasterPublicKeyP *master_pub,
|
const struct TALER_MasterPublicKeyP *master_pub,
|
||||||
uint64_t *last_reserve_in_serial_id,
|
struct TALER_AUDITORDB_ProgressPoint *pp);
|
||||||
uint64_t *last_reserve_out_serial_id,
|
|
||||||
uint64_t *last_deposit_serial_id,
|
|
||||||
uint64_t *last_melt_serial_id,
|
|
||||||
uint64_t *last_refund_serial_id,
|
|
||||||
uint64_t *last_prewire_serial_id);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user