updating DB schema for new wire history operations and future auditor checks of wire transfers
This commit is contained in:
parent
2c05a4b278
commit
76545519c6
@ -615,6 +615,8 @@ struct ReserveContext
|
|||||||
* @param credit amount that was received
|
* @param credit amount that was received
|
||||||
* @param sender_account_details information about the sender's bank account
|
* @param sender_account_details information about the sender's bank account
|
||||||
* @param transfer_details information that uniquely identifies the wire transfer
|
* @param transfer_details information that uniquely identifies the wire transfer
|
||||||
|
* @param wire_reference unique reference identifying the wire transfer (binary blob)
|
||||||
|
* @param wire_reference_size number of bytes in @a wire_reference
|
||||||
* @param execution_date when did we receive the funds
|
* @param execution_date when did we receive the funds
|
||||||
* @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop
|
* @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop
|
||||||
*/
|
*/
|
||||||
@ -625,6 +627,8 @@ handle_reserve_in (void *cls,
|
|||||||
const struct TALER_Amount *credit,
|
const struct TALER_Amount *credit,
|
||||||
const json_t *sender_account_details,
|
const json_t *sender_account_details,
|
||||||
const json_t *transfer_details,
|
const json_t *transfer_details,
|
||||||
|
const void *wire_reference,
|
||||||
|
size_t wire_reference_size,
|
||||||
struct GNUNET_TIME_Absolute execution_date)
|
struct GNUNET_TIME_Absolute execution_date)
|
||||||
{
|
{
|
||||||
struct ReserveContext *rc = cls;
|
struct ReserveContext *rc = cls;
|
||||||
@ -633,7 +637,7 @@ handle_reserve_in (void *cls,
|
|||||||
struct GNUNET_TIME_Absolute expiry;
|
struct GNUNET_TIME_Absolute expiry;
|
||||||
|
|
||||||
/* should be monotonically increasing */
|
/* should be monotonically increasing */
|
||||||
GNUNET_assert (rowid >= pp.last_reserve_in_serial_id);
|
GNUNET_assert (rowid >= pp.last_reserve_in_serial_id);
|
||||||
pp.last_reserve_in_serial_id = rowid + 1;
|
pp.last_reserve_in_serial_id = rowid + 1;
|
||||||
|
|
||||||
GNUNET_CRYPTO_hash (reserve_pub,
|
GNUNET_CRYPTO_hash (reserve_pub,
|
||||||
@ -904,13 +908,13 @@ handle_payback_by_reserve (void *cls,
|
|||||||
{
|
{
|
||||||
report_row_inconsistency ("payback",
|
report_row_inconsistency ("payback",
|
||||||
rowid,
|
rowid,
|
||||||
"denomination key not in revocation set");
|
"denomination key not in revocation set");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* verify msig */
|
/* verify msig */
|
||||||
struct TALER_MasterDenominationKeyRevocation kr;
|
struct TALER_MasterDenominationKeyRevocation kr;
|
||||||
|
|
||||||
kr.purpose.purpose = htonl (TALER_SIGNATURE_MASTER_DENOMINATION_KEY_REVOKED);
|
kr.purpose.purpose = htonl (TALER_SIGNATURE_MASTER_DENOMINATION_KEY_REVOKED);
|
||||||
kr.purpose.size = htonl (sizeof (kr));
|
kr.purpose.size = htonl (sizeof (kr));
|
||||||
kr.h_denom_pub = pr.h_denom_pub;
|
kr.h_denom_pub = pr.h_denom_pub;
|
||||||
@ -1012,7 +1016,7 @@ handle_reserve_closed (void *cls,
|
|||||||
struct ReserveContext *rc = cls;
|
struct ReserveContext *rc = cls;
|
||||||
struct GNUNET_HashCode key;
|
struct GNUNET_HashCode key;
|
||||||
struct ReserveSummary *rs;
|
struct ReserveSummary *rs;
|
||||||
|
|
||||||
/* should be monotonically increasing */
|
/* should be monotonically increasing */
|
||||||
GNUNET_assert (rowid >= pp.last_reserve_close_serial_id);
|
GNUNET_assert (rowid >= pp.last_reserve_close_serial_id);
|
||||||
pp.last_reserve_close_serial_id = rowid + 1;
|
pp.last_reserve_close_serial_id = rowid + 1;
|
||||||
|
@ -95,6 +95,8 @@ run_transaction (const struct TALER_ReservePublicKeyP *reserve_pub,
|
|||||||
add_value,
|
add_value,
|
||||||
GNUNET_TIME_absolute_get (),
|
GNUNET_TIME_absolute_get (),
|
||||||
jdetails,
|
jdetails,
|
||||||
|
"FIXME",
|
||||||
|
5,
|
||||||
tdetails);
|
tdetails);
|
||||||
if (GNUNET_SYSERR == ret)
|
if (GNUNET_SYSERR == ret)
|
||||||
{
|
{
|
||||||
|
@ -1880,6 +1880,8 @@ TEH_DB_execute_admin_add_incoming (struct MHD_Connection *connection,
|
|||||||
amount,
|
amount,
|
||||||
execution_time,
|
execution_time,
|
||||||
sender_account_details,
|
sender_account_details,
|
||||||
|
"FIXME",
|
||||||
|
5,
|
||||||
transfer_details);
|
transfer_details);
|
||||||
if (GNUNET_SYSERR == ret)
|
if (GNUNET_SYSERR == ret)
|
||||||
{
|
{
|
||||||
|
@ -40,7 +40,7 @@
|
|||||||
* Handle to the plugin.
|
* Handle to the plugin.
|
||||||
*/
|
*/
|
||||||
static struct TALER_WIRE_Plugin *wire_plugin;
|
static struct TALER_WIRE_Plugin *wire_plugin;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Which currency is used by this exchange?
|
* Which currency is used by this exchange?
|
||||||
*/
|
*/
|
||||||
@ -63,7 +63,7 @@ static struct TALER_EXCHANGEDB_Plugin *db_plugin;
|
|||||||
static int global_ret;
|
static int global_ret;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Encoded offset in the wire transfer list that we
|
* Encoded offset in the wire transfer list that we
|
||||||
* processed last.
|
* processed last.
|
||||||
*/
|
*/
|
||||||
static void *last_row_off;
|
static void *last_row_off;
|
||||||
@ -180,7 +180,7 @@ exchange_serve_process_config ()
|
|||||||
TALER_EXCHANGEDB_plugin_unload (db_plugin);
|
TALER_EXCHANGEDB_plugin_unload (db_plugin);
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
return GNUNET_OK;
|
return GNUNET_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -248,16 +248,18 @@ history_cb (void *cls,
|
|||||||
{
|
{
|
||||||
/* FIXME: need way to wire money back immediately... */
|
/* FIXME: need way to wire money back immediately... */
|
||||||
GNUNET_break (0); // not implemented
|
GNUNET_break (0); // not implemented
|
||||||
|
|
||||||
return GNUNET_OK;
|
return GNUNET_OK;
|
||||||
}
|
}
|
||||||
// FIXME: store row_off+row_off_size instead of json_t?
|
// FIXME: create json!
|
||||||
ret = db_plugin->reserves_in_insert (db_plugin->cls,
|
ret = db_plugin->reserves_in_insert (db_plugin->cls,
|
||||||
session,
|
session,
|
||||||
&reserve_pub,
|
&reserve_pub,
|
||||||
&details->amount,
|
&details->amount,
|
||||||
details->execution_date,
|
details->execution_date,
|
||||||
details->account_details,
|
details->account_details,
|
||||||
|
row_off,
|
||||||
|
row_off_size,
|
||||||
NULL /* FIXME */);
|
NULL /* FIXME */);
|
||||||
if (GNUNET_OK != ret)
|
if (GNUNET_OK != ret)
|
||||||
{
|
{
|
||||||
@ -269,7 +271,7 @@ history_cb (void *cls,
|
|||||||
NULL);
|
NULL);
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (last_row_off_size != row_off_size)
|
if (last_row_off_size != row_off_size)
|
||||||
{
|
{
|
||||||
GNUNET_free_non_null (last_row_off);
|
GNUNET_free_non_null (last_row_off);
|
||||||
@ -291,7 +293,7 @@ static void
|
|||||||
find_transfers (void *cls)
|
find_transfers (void *cls)
|
||||||
{
|
{
|
||||||
struct TALER_EXCHANGEDB_Session *session;
|
struct TALER_EXCHANGEDB_Session *session;
|
||||||
|
|
||||||
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
|
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
|
||||||
"Checking for incoming wire transfers\n");
|
"Checking for incoming wire transfers\n");
|
||||||
|
|
||||||
@ -357,7 +359,7 @@ run (void *cls,
|
|||||||
global_ret = 1;
|
global_ret = 1;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
task = GNUNET_SCHEDULER_add_now (&find_transfers,
|
task = GNUNET_SCHEDULER_add_now (&find_transfers,
|
||||||
NULL);
|
NULL);
|
||||||
GNUNET_SCHEDULER_add_shutdown (&shutdown_task,
|
GNUNET_SCHEDULER_add_shutdown (&shutdown_task,
|
||||||
|
@ -1394,6 +1394,8 @@ interpret (struct PERF_TALER_EXCHANGEDB_interpreter_state *state)
|
|||||||
&reserve->reserve.balance,
|
&reserve->reserve.balance,
|
||||||
GNUNET_TIME_absolute_get (),
|
GNUNET_TIME_absolute_get (),
|
||||||
sndr,
|
sndr,
|
||||||
|
"PERF",
|
||||||
|
4,
|
||||||
just);
|
just);
|
||||||
GNUNET_assert (GNUNET_SYSERR != ret);
|
GNUNET_assert (GNUNET_SYSERR != ret);
|
||||||
json_decref (sndr);
|
json_decref (sndr);
|
||||||
|
@ -35,7 +35,7 @@ common_free_reserve_history (void *cls,
|
|||||||
struct TALER_EXCHANGEDB_Payback *payback;
|
struct TALER_EXCHANGEDB_Payback *payback;
|
||||||
struct TALER_EXCHANGEDB_ReserveHistory *backref;
|
struct TALER_EXCHANGEDB_ReserveHistory *backref;
|
||||||
struct TALER_EXCHANGEDB_ClosingTransfer *closing;
|
struct TALER_EXCHANGEDB_ClosingTransfer *closing;
|
||||||
|
|
||||||
while (NULL != rh)
|
while (NULL != rh)
|
||||||
{
|
{
|
||||||
switch(rh->type)
|
switch(rh->type)
|
||||||
@ -46,6 +46,7 @@ common_free_reserve_history (void *cls,
|
|||||||
json_decref (bt->sender_account_details);
|
json_decref (bt->sender_account_details);
|
||||||
if (NULL != bt->transfer_details)
|
if (NULL != bt->transfer_details)
|
||||||
json_decref (bt->transfer_details);
|
json_decref (bt->transfer_details);
|
||||||
|
GNUNET_free_non_null (bt->wire_reference);
|
||||||
GNUNET_free (bt);
|
GNUNET_free (bt);
|
||||||
break;
|
break;
|
||||||
case TALER_EXCHANGEDB_RO_WITHDRAW_COIN:
|
case TALER_EXCHANGEDB_RO_WITHDRAW_COIN:
|
||||||
|
@ -352,13 +352,14 @@ postgres_create_tables (void *cls)
|
|||||||
SQLEXEC("CREATE TABLE IF NOT EXISTS reserves_in"
|
SQLEXEC("CREATE TABLE IF NOT EXISTS reserves_in"
|
||||||
"(reserve_in_serial_id BIGSERIAL"
|
"(reserve_in_serial_id BIGSERIAL"
|
||||||
",reserve_pub BYTEA NOT NULL REFERENCES reserves (reserve_pub) ON DELETE CASCADE"
|
",reserve_pub BYTEA NOT NULL REFERENCES reserves (reserve_pub) ON DELETE CASCADE"
|
||||||
|
",wire_reference BYTEA NOT NULL"
|
||||||
",credit_val INT8 NOT NULL"
|
",credit_val INT8 NOT NULL"
|
||||||
",credit_frac INT4 NOT NULL"
|
",credit_frac INT4 NOT NULL"
|
||||||
",credit_curr VARCHAR("TALER_CURRENCY_LEN_STR") NOT NULL"
|
",credit_curr VARCHAR("TALER_CURRENCY_LEN_STR") NOT NULL"
|
||||||
",sender_account_details TEXT NOT NULL "
|
",sender_account_details TEXT NOT NULL"
|
||||||
",transfer_details TEXT NOT NULL "
|
",transfer_details TEXT NOT NULL"
|
||||||
",execution_date INT8 NOT NULL"
|
",execution_date INT8 NOT NULL"
|
||||||
",PRIMARY KEY (reserve_pub, transfer_details)"
|
",PRIMARY KEY (reserve_pub, wire_reference)"
|
||||||
");");
|
");");
|
||||||
/* Create indices on reserves_in */
|
/* Create indices on reserves_in */
|
||||||
SQLEXEC_INDEX ("CREATE INDEX reserves_in_execution_index"
|
SQLEXEC_INDEX ("CREATE INDEX reserves_in_execution_index"
|
||||||
@ -381,7 +382,7 @@ postgres_create_tables (void *cls)
|
|||||||
")");
|
")");
|
||||||
SQLEXEC_INDEX("CREATE INDEX reserves_close_by_reserve "
|
SQLEXEC_INDEX("CREATE INDEX reserves_close_by_reserve "
|
||||||
"ON reserves_close(reserve_pub)");
|
"ON reserves_close(reserve_pub)");
|
||||||
|
|
||||||
/* Table with the withdraw operations that have been performed on a reserve.
|
/* Table with the withdraw operations that have been performed on a reserve.
|
||||||
The 'h_blind_ev' is the hash of the blinded coin. It serves as a primary
|
The 'h_blind_ev' is the hash of the blinded coin. It serves as a primary
|
||||||
key, as (broken) clients that use a non-random coin and blinding factor
|
key, as (broken) clients that use a non-random coin and blinding factor
|
||||||
@ -587,7 +588,7 @@ postgres_create_tables (void *cls)
|
|||||||
SQLEXEC_INDEX("CREATE INDEX prepare_iteration_index "
|
SQLEXEC_INDEX("CREATE INDEX prepare_iteration_index "
|
||||||
"ON prewire(type,finished)");
|
"ON prewire(type,finished)");
|
||||||
|
|
||||||
|
|
||||||
#undef SQLEXEC
|
#undef SQLEXEC
|
||||||
#undef SQLEXEC_INDEX
|
#undef SQLEXEC_INDEX
|
||||||
|
|
||||||
@ -758,6 +759,7 @@ postgres_prepare (PGconn *db_conn)
|
|||||||
PREPARE ("reserves_in_add_transaction",
|
PREPARE ("reserves_in_add_transaction",
|
||||||
"INSERT INTO reserves_in "
|
"INSERT INTO reserves_in "
|
||||||
"(reserve_pub"
|
"(reserve_pub"
|
||||||
|
",wire_reference"
|
||||||
",credit_val"
|
",credit_val"
|
||||||
",credit_frac"
|
",credit_frac"
|
||||||
",credit_curr"
|
",credit_curr"
|
||||||
@ -765,8 +767,8 @@ postgres_prepare (PGconn *db_conn)
|
|||||||
",transfer_details"
|
",transfer_details"
|
||||||
",execution_date"
|
",execution_date"
|
||||||
") VALUES "
|
") VALUES "
|
||||||
"($1, $2, $3, $4, $5, $6, $7);",
|
"($1, $2, $3, $4, $5, $6, $7, $8);",
|
||||||
7, NULL);
|
8, NULL);
|
||||||
|
|
||||||
|
|
||||||
/* Used in postgres_select_reserves_in_above_serial_id() to obtain inbound
|
/* Used in postgres_select_reserves_in_above_serial_id() to obtain inbound
|
||||||
@ -774,6 +776,7 @@ postgres_prepare (PGconn *db_conn)
|
|||||||
PREPARE ("audit_reserves_in_get_transactions_incr",
|
PREPARE ("audit_reserves_in_get_transactions_incr",
|
||||||
"SELECT"
|
"SELECT"
|
||||||
" reserve_pub"
|
" reserve_pub"
|
||||||
|
",wire_reference"
|
||||||
",credit_val"
|
",credit_val"
|
||||||
",credit_frac"
|
",credit_frac"
|
||||||
",credit_curr"
|
",credit_curr"
|
||||||
@ -790,7 +793,8 @@ postgres_prepare (PGconn *db_conn)
|
|||||||
for a reserve */
|
for a reserve */
|
||||||
PREPARE ("reserves_in_get_transactions",
|
PREPARE ("reserves_in_get_transactions",
|
||||||
"SELECT"
|
"SELECT"
|
||||||
" credit_val"
|
" wire_reference"
|
||||||
|
",credit_val"
|
||||||
",credit_frac"
|
",credit_frac"
|
||||||
",credit_curr"
|
",credit_curr"
|
||||||
",execution_date"
|
",execution_date"
|
||||||
@ -1531,7 +1535,7 @@ postgres_prepare (PGconn *db_conn)
|
|||||||
" ORDER BY payback_uuid ASC",
|
" ORDER BY payback_uuid ASC",
|
||||||
1, NULL);
|
1, NULL);
|
||||||
|
|
||||||
/* Used in #postgres_select_reserve_closed_above_serial_id() to
|
/* Used in #postgres_select_reserve_closed_above_serial_id() to
|
||||||
obtain information about closed reserves */
|
obtain information about closed reserves */
|
||||||
PREPARE ("reserves_close_get_incr",
|
PREPARE ("reserves_close_get_incr",
|
||||||
"SELECT"
|
"SELECT"
|
||||||
@ -2074,6 +2078,8 @@ reserves_update (void *cls,
|
|||||||
* @param balance the amount that has to be added to the reserve
|
* @param balance the amount that has to be added to the reserve
|
||||||
* @param execution_time when was the amount added
|
* @param execution_time when was the amount added
|
||||||
* @param sender_account_details account information for the sender
|
* @param sender_account_details account information for the sender
|
||||||
|
* @param wire_reference unique reference identifying the wire transfer (binary blob)
|
||||||
|
* @param wire_reference_size number of bytes in @a wire_reference
|
||||||
* @param transfer_details information that uniquely identifies the transfer
|
* @param transfer_details information that uniquely identifies the transfer
|
||||||
* @return #GNUNET_OK upon success; #GNUNET_NO if the given
|
* @return #GNUNET_OK upon success; #GNUNET_NO if the given
|
||||||
* @a details are already known for this @a reserve_pub,
|
* @a details are already known for this @a reserve_pub,
|
||||||
@ -2086,6 +2092,8 @@ postgres_reserves_in_insert (void *cls,
|
|||||||
const struct TALER_Amount *balance,
|
const struct TALER_Amount *balance,
|
||||||
struct GNUNET_TIME_Absolute execution_time,
|
struct GNUNET_TIME_Absolute execution_time,
|
||||||
const json_t *sender_account_details,
|
const json_t *sender_account_details,
|
||||||
|
const void *wire_reference,
|
||||||
|
size_t wire_reference_size,
|
||||||
const json_t *transfer_details)
|
const json_t *transfer_details)
|
||||||
{
|
{
|
||||||
struct PostgresClosure *pg = cls;
|
struct PostgresClosure *pg = cls;
|
||||||
@ -2127,7 +2135,7 @@ postgres_reserves_in_insert (void *cls,
|
|||||||
the wire transfer subjects (i.e. when using Bitcoin).
|
the wire transfer subjects (i.e. when using Bitcoin).
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
expiry = GNUNET_TIME_absolute_add (execution_time,
|
expiry = GNUNET_TIME_absolute_add (execution_time,
|
||||||
pg->idle_reserve_expiration_time);
|
pg->idle_reserve_expiration_time);
|
||||||
if (GNUNET_NO == reserve_exists)
|
if (GNUNET_NO == reserve_exists)
|
||||||
@ -2166,6 +2174,8 @@ postgres_reserves_in_insert (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_fixed_size (wire_reference,
|
||||||
|
wire_reference_size),
|
||||||
TALER_PQ_query_param_amount (balance),
|
TALER_PQ_query_param_amount (balance),
|
||||||
TALER_PQ_query_param_json (sender_account_details),
|
TALER_PQ_query_param_json (sender_account_details),
|
||||||
TALER_PQ_query_param_json (transfer_details),
|
TALER_PQ_query_param_json (transfer_details),
|
||||||
@ -2460,6 +2470,9 @@ postgres_get_reserve_history (void *cls,
|
|||||||
bt = GNUNET_new (struct TALER_EXCHANGEDB_BankTransfer);
|
bt = GNUNET_new (struct TALER_EXCHANGEDB_BankTransfer);
|
||||||
{
|
{
|
||||||
struct GNUNET_PQ_ResultSpec rs[] = {
|
struct GNUNET_PQ_ResultSpec rs[] = {
|
||||||
|
GNUNET_PQ_result_spec_variable_size ("wire_reference",
|
||||||
|
&bt->wire_reference,
|
||||||
|
&bt->wire_reference_size),
|
||||||
TALER_PQ_result_spec_amount ("credit",
|
TALER_PQ_result_spec_amount ("credit",
|
||||||
&bt->amount),
|
&bt->amount),
|
||||||
GNUNET_PQ_result_spec_absolute_time ("execution_date",
|
GNUNET_PQ_result_spec_absolute_time ("execution_date",
|
||||||
@ -2690,7 +2703,7 @@ postgres_get_reserve_history (void *cls,
|
|||||||
PQclear (result);
|
PQclear (result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
if (GNUNET_SYSERR == ret)
|
if (GNUNET_SYSERR == ret)
|
||||||
{
|
{
|
||||||
@ -5037,7 +5050,7 @@ postgres_get_expired_reserves (void *cls,
|
|||||||
&remaining_balance),
|
&remaining_balance),
|
||||||
GNUNET_PQ_result_spec_end
|
GNUNET_PQ_result_spec_end
|
||||||
};
|
};
|
||||||
|
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
GNUNET_PQ_extract_result (result,
|
GNUNET_PQ_extract_result (result,
|
||||||
rs,
|
rs,
|
||||||
@ -5097,7 +5110,7 @@ postgres_insert_reserve_closed (void *cls,
|
|||||||
};
|
};
|
||||||
PGresult *result;
|
PGresult *result;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
result = GNUNET_PQ_exec_prepared (session->conn,
|
result = GNUNET_PQ_exec_prepared (session->conn,
|
||||||
"reserves_close_insert",
|
"reserves_close_insert",
|
||||||
params);
|
params);
|
||||||
@ -5830,10 +5843,15 @@ postgres_select_reserves_in_above_serial_id (void *cls,
|
|||||||
json_t *transfer_details;
|
json_t *transfer_details;
|
||||||
struct GNUNET_TIME_Absolute execution_date;
|
struct GNUNET_TIME_Absolute execution_date;
|
||||||
uint64_t rowid;
|
uint64_t rowid;
|
||||||
|
void *wire_reference;
|
||||||
|
size_t wire_reference_size;
|
||||||
|
|
||||||
struct GNUNET_PQ_ResultSpec rs[] = {
|
struct GNUNET_PQ_ResultSpec rs[] = {
|
||||||
GNUNET_PQ_result_spec_auto_from_type ("reserve_pub",
|
GNUNET_PQ_result_spec_auto_from_type ("reserve_pub",
|
||||||
&reserve_pub),
|
&reserve_pub),
|
||||||
|
GNUNET_PQ_result_spec_variable_size ("wire_reference",
|
||||||
|
&wire_reference,
|
||||||
|
&wire_reference_size),
|
||||||
TALER_PQ_result_spec_amount ("credit",
|
TALER_PQ_result_spec_amount ("credit",
|
||||||
&credit),
|
&credit),
|
||||||
GNUNET_PQ_result_spec_absolute_time("execution_date",
|
GNUNET_PQ_result_spec_absolute_time("execution_date",
|
||||||
@ -5862,6 +5880,8 @@ postgres_select_reserves_in_above_serial_id (void *cls,
|
|||||||
&credit,
|
&credit,
|
||||||
sender_account_details,
|
sender_account_details,
|
||||||
transfer_details,
|
transfer_details,
|
||||||
|
wire_reference,
|
||||||
|
wire_reference_size,
|
||||||
execution_date);
|
execution_date);
|
||||||
GNUNET_PQ_cleanup_result (rs);
|
GNUNET_PQ_cleanup_result (rs);
|
||||||
if (GNUNET_OK != ret)
|
if (GNUNET_OK != ret)
|
||||||
|
@ -1033,6 +1033,8 @@ audit_refund_cb (void *cls,
|
|||||||
* @param credit amount that was received
|
* @param credit amount that was received
|
||||||
* @param sender_account_details information about the sender's bank account
|
* @param sender_account_details information about the sender's bank account
|
||||||
* @param transfer_details information that uniquely identifies the wire transfer
|
* @param transfer_details information that uniquely identifies the wire transfer
|
||||||
|
* @param wire_reference unique reference identifying the wire transfer (binary blob)
|
||||||
|
* @param wire_reference_size number of bytes in @a wire_reference
|
||||||
* @param execution_date when did we receive the funds
|
* @param execution_date when did we receive the funds
|
||||||
* @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop
|
* @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop
|
||||||
*/
|
*/
|
||||||
@ -1043,6 +1045,8 @@ audit_reserve_in_cb (void *cls,
|
|||||||
const struct TALER_Amount *credit,
|
const struct TALER_Amount *credit,
|
||||||
const json_t *sender_account_details,
|
const json_t *sender_account_details,
|
||||||
const json_t *transfer_details,
|
const json_t *transfer_details,
|
||||||
|
const void *wire_reference,
|
||||||
|
size_t wire_reference_size,
|
||||||
struct GNUNET_TIME_Absolute execution_date)
|
struct GNUNET_TIME_Absolute execution_date)
|
||||||
{
|
{
|
||||||
auditor_row_cnt++;
|
auditor_row_cnt++;
|
||||||
@ -1511,6 +1515,8 @@ run (void *cls)
|
|||||||
&value,
|
&value,
|
||||||
GNUNET_TIME_absolute_get (),
|
GNUNET_TIME_absolute_get (),
|
||||||
sndr,
|
sndr,
|
||||||
|
"TEST",
|
||||||
|
4,
|
||||||
just));
|
just));
|
||||||
json_decref (just);
|
json_decref (just);
|
||||||
FAILIF (GNUNET_OK !=
|
FAILIF (GNUNET_OK !=
|
||||||
@ -1527,6 +1533,8 @@ run (void *cls)
|
|||||||
&value,
|
&value,
|
||||||
GNUNET_TIME_absolute_get (),
|
GNUNET_TIME_absolute_get (),
|
||||||
sndr,
|
sndr,
|
||||||
|
"TEST2",
|
||||||
|
5,
|
||||||
just));
|
just));
|
||||||
json_decref (just);
|
json_decref (just);
|
||||||
json_decref (sndr);
|
json_decref (sndr);
|
||||||
@ -1642,8 +1650,8 @@ run (void *cls)
|
|||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
value.currency));
|
value.currency));
|
||||||
|
|
||||||
json_decref (sndr);
|
json_decref (sndr);
|
||||||
result = 7;
|
result = 7;
|
||||||
rh = plugin->get_reserve_history (plugin->cls,
|
rh = plugin->get_reserve_history (plugin->cls,
|
||||||
session,
|
session,
|
||||||
|
@ -61,11 +61,21 @@ struct TALER_EXCHANGEDB_BankTransfer
|
|||||||
*/
|
*/
|
||||||
json_t *transfer_details;
|
json_t *transfer_details;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Data uniquely identifying the wire transfer (wire transfer-type specific)
|
||||||
|
*/
|
||||||
|
void *wire_reference;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Number of bytes in @e wire_reference.
|
||||||
|
*/
|
||||||
|
size_t wire_reference_size;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Information we keep on bank transfer(s) that
|
* @brief Information we keep on bank transfer(s) that
|
||||||
* closed a reserve.
|
* closed a reserve.
|
||||||
*/
|
*/
|
||||||
struct TALER_EXCHANGEDB_ClosingTransfer
|
struct TALER_EXCHANGEDB_ClosingTransfer
|
||||||
@ -101,7 +111,7 @@ struct TALER_EXCHANGEDB_ClosingTransfer
|
|||||||
* wire transfer.
|
* wire transfer.
|
||||||
*/
|
*/
|
||||||
struct TALER_WireTransferIdentifierRawP transfer_details;
|
struct TALER_WireTransferIdentifierRawP transfer_details;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -800,6 +810,8 @@ typedef int
|
|||||||
* @param credit amount that was received
|
* @param credit amount that was received
|
||||||
* @param sender_account_details information about the sender's bank account
|
* @param sender_account_details information about the sender's bank account
|
||||||
* @param transfer_details information that uniquely identifies the wire transfer
|
* @param transfer_details information that uniquely identifies the wire transfer
|
||||||
|
* @param wire_reference unique identifier for the wire transfer (plugin-specific format)
|
||||||
|
* @param wire_reference_size number of bytes in @a wire_reference
|
||||||
* @param execution_date when did we receive the funds
|
* @param execution_date when did we receive the funds
|
||||||
* @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop
|
* @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop
|
||||||
*/
|
*/
|
||||||
@ -810,6 +822,8 @@ typedef int
|
|||||||
const struct TALER_Amount *credit,
|
const struct TALER_Amount *credit,
|
||||||
const json_t *sender_account_details,
|
const json_t *sender_account_details,
|
||||||
const json_t *transfer_details,
|
const json_t *transfer_details,
|
||||||
|
const void *wire_reference,
|
||||||
|
size_t wire_reference_size,
|
||||||
struct GNUNET_TIME_Absolute execution_date);
|
struct GNUNET_TIME_Absolute execution_date);
|
||||||
|
|
||||||
|
|
||||||
@ -1181,6 +1195,8 @@ struct TALER_EXCHANGEDB_Plugin
|
|||||||
* @param balance the amount that has to be added to the reserve
|
* @param balance the amount that has to be added to the reserve
|
||||||
* @param execution_time when was the amount added
|
* @param execution_time when was the amount added
|
||||||
* @param sender_account_details information about the sender's bank account
|
* @param sender_account_details information about the sender's bank account
|
||||||
|
* @param wire_reference unique reference identifying the wire transfer (binary blob)
|
||||||
|
* @param wire_reference_size number of bytes in @a wire_reference
|
||||||
* @param transfer_details information that uniquely identifies the wire transfer
|
* @param transfer_details information that uniquely identifies the wire transfer
|
||||||
* @return #GNUNET_OK upon success; #GNUNET_NO if the given
|
* @return #GNUNET_OK upon success; #GNUNET_NO if the given
|
||||||
* @a details are already known for this @a reserve_pub,
|
* @a details are already known for this @a reserve_pub,
|
||||||
@ -1193,6 +1209,8 @@ struct TALER_EXCHANGEDB_Plugin
|
|||||||
const struct TALER_Amount *balance,
|
const struct TALER_Amount *balance,
|
||||||
struct GNUNET_TIME_Absolute execution_time,
|
struct GNUNET_TIME_Absolute execution_time,
|
||||||
const json_t *sender_account_details,
|
const json_t *sender_account_details,
|
||||||
|
const void *wire_reference,
|
||||||
|
size_t wire_reference_size,
|
||||||
const json_t *transfer_details);
|
const json_t *transfer_details);
|
||||||
|
|
||||||
|
|
||||||
@ -1821,7 +1839,7 @@ struct TALER_EXCHANGEDB_Plugin
|
|||||||
TALER_EXCHANGEDB_ReserveExpiredCallback rec,
|
TALER_EXCHANGEDB_ReserveExpiredCallback rec,
|
||||||
void *rec_cls);
|
void *rec_cls);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Insert reserve close operation into database.
|
* Insert reserve close operation into database.
|
||||||
*
|
*
|
||||||
@ -2102,7 +2120,7 @@ struct TALER_EXCHANGEDB_Plugin
|
|||||||
* @param cls closure
|
* @param cls closure
|
||||||
* @param session database connection
|
* @param session database connection
|
||||||
* @param serial_id lowest serial ID to include (select larger or equal)
|
* @param serial_id lowest serial ID to include (select larger or equal)
|
||||||
* @param cb function to call
|
* @param cb function to call
|
||||||
* @param cb_cls closure for @a cb
|
* @param cb_cls closure for @a cb
|
||||||
* @return #GNUNET_OK on success,
|
* @return #GNUNET_OK on success,
|
||||||
* #GNUNET_NO if there are no entries,
|
* #GNUNET_NO if there are no entries,
|
||||||
|
Loading…
Reference in New Issue
Block a user