-remove sessions also from auditor

This commit is contained in:
Christian Grothoff 2021-08-23 08:24:59 +02:00
parent 82a5038acf
commit 01e06eb715
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC
16 changed files with 211 additions and 557 deletions

View File

@ -46,11 +46,6 @@ const struct GNUNET_CONFIGURATION_Handle *TALER_ARL_cfg;
*/
struct TALER_AUDITORDB_Plugin *TALER_ARL_adb;
/**
* Our session with the #TALER_ARL_adb.
*/
struct TALER_AUDITORDB_Session *TALER_ARL_asession;
/**
* Master public key of the exchange to audit.
*/
@ -310,8 +305,7 @@ transact (TALER_ARL_Analysis analysis,
int ret;
enum GNUNET_DB_QueryStatus qs;
ret = TALER_ARL_adb->start (TALER_ARL_adb->cls,
TALER_ARL_asession);
ret = TALER_ARL_adb->start (TALER_ARL_adb->cls);
if (GNUNET_OK != ret)
{
GNUNET_break (0);
@ -340,13 +334,11 @@ transact (TALER_ARL_Analysis analysis,
GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qs);
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Exchange DB commit failed, rolling back transaction\n");
TALER_ARL_adb->rollback (TALER_ARL_adb->cls,
TALER_ARL_asession);
TALER_ARL_adb->rollback (TALER_ARL_adb->cls);
}
else
{
qs = TALER_ARL_adb->commit (TALER_ARL_adb->cls,
TALER_ARL_asession);
qs = TALER_ARL_adb->commit (TALER_ARL_adb->cls);
if (0 > qs)
{
GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qs);
@ -359,8 +351,7 @@ transact (TALER_ARL_Analysis analysis,
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Processing failed (or no changes), rolling back transaction\n");
TALER_ARL_adb->rollback (TALER_ARL_adb->cls,
TALER_ARL_asession);
TALER_ARL_adb->rollback (TALER_ARL_adb->cls);
TALER_ARL_edb->rollback (TALER_ARL_edb->cls);
}
switch (qs)
@ -389,15 +380,15 @@ int
TALER_ARL_setup_sessions_and_run (TALER_ARL_Analysis ana,
void *ana_cls)
{
if (GNUNET_OK !=
if (GNUNET_SYSERR ==
TALER_ARL_edb->preflight (TALER_ARL_edb->cls))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Failed to initialize exchange connection.\n");
return GNUNET_SYSERR;
}
TALER_ARL_asession = TALER_ARL_adb->get_session (TALER_ARL_adb->cls);
if (NULL == TALER_ARL_asession)
if (GNUNET_SYSERR ==
TALER_ARL_adb->preflight (TALER_ARL_adb->cls))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Failed to initialize auditor session.\n");
@ -804,11 +795,10 @@ TALER_ARL_init (const struct GNUNET_CONFIGURATION_Handle *c)
return GNUNET_SYSERR;
}
{
struct TALER_AUDITORDB_Session *as;
int found;
as = TALER_ARL_adb->get_session (TALER_ARL_adb->cls);
if (NULL == as)
if (GNUNET_SYSERR ==
TALER_ARL_adb->preflight (TALER_ARL_adb->cls))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Failed to start session with auditor database.\n");
@ -817,7 +807,6 @@ TALER_ARL_init (const struct GNUNET_CONFIGURATION_Handle *c)
}
found = GNUNET_NO;
(void) TALER_ARL_adb->list_exchanges (TALER_ARL_adb->cls,
as,
&test_master_present,
&found);
if (GNUNET_NO == found)

View File

@ -59,11 +59,6 @@ extern const struct GNUNET_CONFIGURATION_Handle *TALER_ARL_cfg;
*/
extern struct TALER_AUDITORDB_Plugin *TALER_ARL_adb;
/**
* Our session with the #TALER_ARL_adb.
*/
extern struct TALER_AUDITORDB_Session *TALER_ARL_asession;
/**
* Master public key of the exchange to audit.
*/

View File

@ -1,6 +1,6 @@
/*
This file is part of TALER
Copyright (C) 2014, 2015, 2018, 2019 Taler Systems SA
Copyright (C) 2014-2021 Taler Systems SA
TALER is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
@ -176,13 +176,12 @@ main (int argc,
/* Update DB */
{
enum GNUNET_DB_QueryStatus qs;
struct TALER_AUDITORDB_Session *session;
session = adb->get_session (adb->cls);
if (NULL == session)
if (GNUNET_SYSERR ==
adb->preflight (adb->cls))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Failed to initialize database session\n");
"Failed to initialize database connection\n");
TALER_AUDITORDB_plugin_unload (adb);
return EXIT_FAILURE;
}
@ -190,13 +189,11 @@ main (int argc,
if (remove_flag)
{
qs = adb->delete_exchange (adb->cls,
session,
&master_public_key);
}
else
{
qs = adb->insert_exchange (adb->cls,
session,
&master_public_key,
exchange_url);
}

View File

@ -62,7 +62,6 @@ verify_and_execute_deposit_confirmation (
const struct TALER_AUDITORDB_DepositConfirmation *dc,
const struct TALER_AUDITORDB_ExchangeSigningKey *es)
{
struct TALER_AUDITORDB_Session *session;
enum GNUNET_DB_QueryStatus qs;
struct GNUNET_TIME_Absolute now;
struct GNUNET_HashCode h;
@ -96,8 +95,8 @@ verify_and_execute_deposit_confirmation (
cached = GNUNET_CONTAINER_multihashmap_get (cache,
&h);
GNUNET_assert (0 == pthread_mutex_unlock (&lock));
session = TAH_plugin->get_session (TAH_plugin->cls);
if (NULL == session)
if (GNUNET_SYSERR ==
TAH_plugin->preflight (TAH_plugin->cls))
{
GNUNET_break (0);
return TALER_MHD_reply_with_error (connection,
@ -126,7 +125,6 @@ verify_and_execute_deposit_confirmation (
/* execute transaction */
qs = TAH_plugin->insert_exchange_signkey (TAH_plugin->cls,
session,
es);
if (0 > qs)
{
@ -216,7 +214,6 @@ verify_and_execute_deposit_confirmation (
/* execute transaction */
qs = TAH_plugin->insert_deposit_confirmation (TAH_plugin->cls,
session,
dc);
if (0 > qs)
{

View File

@ -75,15 +75,14 @@ TAH_EXCHANGES_handler (struct TAH_RequestHandler *rh,
size_t *upload_data_size)
{
json_t *ja;
struct TALER_AUDITORDB_Session *session;
enum GNUNET_DB_QueryStatus qs;
(void) rh;
(void) connection_cls;
(void) upload_data;
(void) upload_data_size;
session = TAH_plugin->get_session (TAH_plugin->cls);
if (NULL == session)
if (GNUNET_SYSERR ==
TAH_plugin->preflight (TAH_plugin->cls))
{
GNUNET_break (0);
return TALER_MHD_reply_with_error (connection,
@ -94,7 +93,6 @@ TAH_EXCHANGES_handler (struct TAH_RequestHandler *rh,
ja = json_array ();
GNUNET_break (NULL != ja);
qs = TAH_plugin->list_exchanges (TAH_plugin->cls,
session,
&add_exchange,
ja);
if (0 > qs)

View File

@ -1218,7 +1218,6 @@ analyze_aggregations (void *cls)
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Analyzing aggregations\n");
qsp = TALER_ARL_adb->get_auditor_progress_aggregation (TALER_ARL_adb->cls,
TALER_ARL_asession,
&TALER_ARL_master_pub,
&ppa);
if (0 > qsp)
@ -1243,7 +1242,6 @@ analyze_aggregations (void *cls)
0,
sizeof (ac));
qsx = TALER_ARL_adb->get_wire_fee_summary (TALER_ARL_adb->cls,
TALER_ARL_asession,
&TALER_ARL_master_pub,
&total_aggregation_fee_income);
if (0 > qsx)
@ -1282,13 +1280,11 @@ analyze_aggregations (void *cls)
if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == qsx)
ac.qs = TALER_ARL_adb->insert_wire_fee_summary (
TALER_ARL_adb->cls,
TALER_ARL_asession,
&TALER_ARL_master_pub,
&total_aggregation_fee_income);
else
ac.qs = TALER_ARL_adb->update_wire_fee_summary (
TALER_ARL_adb->cls,
TALER_ARL_asession,
&TALER_ARL_master_pub,
&total_aggregation_fee_income);
if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT != ac.qs)
@ -1299,13 +1295,11 @@ analyze_aggregations (void *cls)
if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT == qsp)
qs = TALER_ARL_adb->update_auditor_progress_aggregation (
TALER_ARL_adb->cls,
TALER_ARL_asession,
&TALER_ARL_master_pub,
&ppa);
else
qs = TALER_ARL_adb->insert_auditor_progress_aggregation (
TALER_ARL_adb->cls,
TALER_ARL_asession,
&TALER_ARL_master_pub,
&ppa);
if (0 >= qs)

View File

@ -679,7 +679,6 @@ init_denomination (const struct GNUNET_HashCode *denom_hash,
uint64_t rowid;
qs = TALER_ARL_adb->get_denomination_balance (TALER_ARL_adb->cls,
TALER_ARL_asession,
denom_hash,
&ds->denom_balance,
&ds->denom_loss,
@ -819,7 +818,6 @@ sync_denomination (void *cls,
outstanding coins as revenue; and reduce cc->risk exposure. */
if (ds->in_db)
qs = TALER_ARL_adb->del_denomination_balance (TALER_ARL_adb->cls,
TALER_ARL_asession,
denom_hash);
else
qs = GNUNET_DB_STATUS_SUCCESS_ONE_RESULT;
@ -851,7 +849,6 @@ sync_denomination (void *cls,
if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
(qs = TALER_ARL_adb->insert_historic_denom_revenue (
TALER_ARL_adb->cls,
TALER_ARL_asession,
&TALER_ARL_master_pub,
denom_hash,
expire_deposit,
@ -905,7 +902,6 @@ sync_denomination (void *cls,
}
if (ds->in_db)
qs = TALER_ARL_adb->update_denomination_balance (TALER_ARL_adb->cls,
TALER_ARL_asession,
denom_hash,
&ds->denom_balance,
&ds->denom_loss,
@ -914,7 +910,6 @@ sync_denomination (void *cls,
ds->num_issued);
else
qs = TALER_ARL_adb->insert_denomination_balance (TALER_ARL_adb->cls,
TALER_ARL_asession,
denom_hash,
&ds->denom_balance,
&ds->denom_loss,
@ -2333,7 +2328,6 @@ analyze_coins (void *cls)
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Analyzing coins\n");
qsp = TALER_ARL_adb->get_auditor_progress_coin (TALER_ARL_adb->cls,
TALER_ARL_asession,
&TALER_ARL_master_pub,
&ppc);
if (0 > qsp)
@ -2363,7 +2357,6 @@ analyze_coins (void *cls)
cc.denom_summaries = GNUNET_CONTAINER_multihashmap_create (256,
GNUNET_NO);
qsx = TALER_ARL_adb->get_balance_summary (TALER_ARL_adb->cls,
TALER_ARL_asession,
&TALER_ARL_master_pub,
&total_escrow_balance,
&total_deposit_fee_income,
@ -2473,7 +2466,6 @@ analyze_coins (void *cls)
}
if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT == qsx)
qs = TALER_ARL_adb->update_balance_summary (TALER_ARL_adb->cls,
TALER_ARL_asession,
&TALER_ARL_master_pub,
&total_escrow_balance,
&total_deposit_fee_income,
@ -2484,7 +2476,6 @@ analyze_coins (void *cls)
&total_irregular_recoups);
else
qs = TALER_ARL_adb->insert_balance_summary (TALER_ARL_adb->cls,
TALER_ARL_asession,
&TALER_ARL_master_pub,
&total_escrow_balance,
&total_deposit_fee_income,
@ -2501,12 +2492,10 @@ analyze_coins (void *cls)
if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT == qsp)
qs = TALER_ARL_adb->update_auditor_progress_coin (TALER_ARL_adb->cls,
TALER_ARL_asession,
&TALER_ARL_master_pub,
&ppc);
else
qs = TALER_ARL_adb->insert_auditor_progress_coin (TALER_ARL_adb->cls,
TALER_ARL_asession,
&TALER_ARL_master_pub,
&ppc);
if (0 >= qs)

View File

@ -188,7 +188,6 @@ analyze_deposit_confirmations (void *cls)
ppdc.last_deposit_confirmation_serial_id = 0;
qsp = TALER_ARL_adb->get_auditor_progress_deposit_confirmation (
TALER_ARL_adb->cls,
TALER_ARL_asession,
&TALER_ARL_master_pub,
&ppdc);
if (0 > qsp)
@ -217,7 +216,6 @@ analyze_deposit_confirmations (void *cls)
dcc.first_missed_coin_serial = UINT64_MAX;
qsx = TALER_ARL_adb->get_deposit_confirmations (
TALER_ARL_adb->cls,
TALER_ARL_asession,
&TALER_ARL_master_pub,
ppdc.last_deposit_confirmation_serial_id,
&test_dc,
@ -245,13 +243,11 @@ analyze_deposit_confirmations (void *cls)
if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT == qsp)
qs = TALER_ARL_adb->update_auditor_progress_deposit_confirmation (
TALER_ARL_adb->cls,
TALER_ARL_asession,
&TALER_ARL_master_pub,
&ppdc);
else
qs = TALER_ARL_adb->insert_auditor_progress_deposit_confirmation (
TALER_ARL_adb->cls,
TALER_ARL_asession,
&TALER_ARL_master_pub,
&ppdc);
if (0 >= qs)

View File

@ -317,7 +317,6 @@ load_auditor_reserve_summary (struct ReserveSummary *rs)
uint64_t rowid;
qs = TALER_ARL_adb->get_reserve_info (TALER_ARL_adb->cls,
TALER_ARL_asession,
&rs->reserve_pub,
&TALER_ARL_master_pub,
&rowid,
@ -1255,7 +1254,6 @@ verify_reserve_balance (void *cls,
TALER_B2S (&rs->reserve_pub),
TALER_amount2s (&nbalance));
qs = TALER_ARL_adb->del_reserve_info (TALER_ARL_adb->cls,
TALER_ARL_asession,
&rs->reserve_pub,
&TALER_ARL_master_pub);
if (0 >= qs)
@ -1282,7 +1280,6 @@ verify_reserve_balance (void *cls,
TALER_amount2s (&nbalance));
if (rs->had_ri)
qs = TALER_ARL_adb->update_reserve_info (TALER_ARL_adb->cls,
TALER_ARL_asession,
&rs->reserve_pub,
&TALER_ARL_master_pub,
&nbalance,
@ -1290,7 +1287,6 @@ verify_reserve_balance (void *cls,
rs->a_expiration_date);
else
qs = TALER_ARL_adb->insert_reserve_info (TALER_ARL_adb->cls,
TALER_ARL_asession,
&rs->reserve_pub,
&TALER_ARL_master_pub,
&nbalance,
@ -1333,7 +1329,6 @@ analyze_reserves (void *cls)
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Analyzing reserves\n");
qsp = TALER_ARL_adb->get_auditor_progress_reserve (TALER_ARL_adb->cls,
TALER_ARL_asession,
&TALER_ARL_master_pub,
&ppr);
if (0 > qsp)
@ -1358,7 +1353,6 @@ analyze_reserves (void *cls)
}
rc.qs = GNUNET_DB_STATUS_SUCCESS_ONE_RESULT;
qsx = TALER_ARL_adb->get_reserve_summary (TALER_ARL_adb->cls,
TALER_ARL_asession,
&TALER_ARL_master_pub,
&total_escrow_balance,
&total_withdraw_fee_income);
@ -1427,7 +1421,6 @@ analyze_reserves (void *cls)
if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == qsx)
{
qs = TALER_ARL_adb->insert_reserve_summary (TALER_ARL_adb->cls,
TALER_ARL_asession,
&TALER_ARL_master_pub,
&total_escrow_balance,
&total_withdraw_fee_income);
@ -1435,7 +1428,6 @@ analyze_reserves (void *cls)
else
{
qs = TALER_ARL_adb->update_reserve_summary (TALER_ARL_adb->cls,
TALER_ARL_asession,
&TALER_ARL_master_pub,
&total_escrow_balance,
&total_withdraw_fee_income);
@ -1447,12 +1439,10 @@ analyze_reserves (void *cls)
}
if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT == qsp)
qs = TALER_ARL_adb->update_auditor_progress_reserve (TALER_ARL_adb->cls,
TALER_ARL_asession,
&TALER_ARL_master_pub,
&ppr);
else
qs = TALER_ARL_adb->insert_auditor_progress_reserve (TALER_ARL_adb->cls,
TALER_ARL_asession,
&TALER_ARL_master_pub,
&ppr);
if (0 >= qs)

View File

@ -663,8 +663,7 @@ commit (enum GNUNET_DB_QueryStatus qs)
else
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Hard error, not recording progress\n");
TALER_ARL_adb->rollback (TALER_ARL_adb->cls,
TALER_ARL_asession);
TALER_ARL_adb->rollback (TALER_ARL_adb->cls);
TALER_ARL_edb->rollback (TALER_ARL_edb->cls);
return qs;
}
@ -691,7 +690,6 @@ commit (enum GNUNET_DB_QueryStatus qs)
if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT == wa->qsx)
qs = TALER_ARL_adb->update_wire_auditor_account_progress (
TALER_ARL_adb->cls,
TALER_ARL_asession,
&TALER_ARL_master_pub,
wa->ai->section_name,
&wa->pp,
@ -700,7 +698,6 @@ commit (enum GNUNET_DB_QueryStatus qs)
else
qs = TALER_ARL_adb->insert_wire_auditor_account_progress (
TALER_ARL_adb->cls,
TALER_ARL_asession,
&TALER_ARL_master_pub,
wa->ai->section_name,
&wa->pp,
@ -719,12 +716,10 @@ commit (enum GNUNET_DB_QueryStatus qs)
NULL);
if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT == qsx_gwap)
qs = TALER_ARL_adb->update_wire_auditor_progress (TALER_ARL_adb->cls,
TALER_ARL_asession,
&TALER_ARL_master_pub,
&pp);
else
qs = TALER_ARL_adb->insert_wire_auditor_progress (TALER_ARL_adb->cls,
TALER_ARL_asession,
&TALER_ARL_master_pub,
&pp);
if (0 >= qs)
@ -746,13 +741,11 @@ commit (enum GNUNET_DB_QueryStatus qs)
GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qs);
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Exchange DB commit failed, rolling back transaction\n");
TALER_ARL_adb->rollback (TALER_ARL_adb->cls,
TALER_ARL_asession);
TALER_ARL_adb->rollback (TALER_ARL_adb->cls);
}
else
{
qs = TALER_ARL_adb->commit (TALER_ARL_adb->cls,
TALER_ARL_asession);
qs = TALER_ARL_adb->commit (TALER_ARL_adb->cls);
if (0 > qs)
{
GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qs);
@ -765,8 +758,7 @@ commit (enum GNUNET_DB_QueryStatus qs)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Processing failed, rolling back transaction\n");
TALER_ARL_adb->rollback (TALER_ARL_adb->cls,
TALER_ARL_asession);
TALER_ARL_adb->rollback (TALER_ARL_adb->cls);
TALER_ARL_edb->rollback (TALER_ARL_edb->cls);
}
return qs;
@ -1947,23 +1939,22 @@ reserve_closed_cb (void *cls,
static enum GNUNET_DB_QueryStatus
begin_transaction (void)
{
if (GNUNET_OK !=
if (GNUNET_SYSERR ==
TALER_ARL_edb->preflight (TALER_ARL_edb->cls))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Failed to initialize exchange database connection.\n");
return GNUNET_DB_STATUS_HARD_ERROR;
}
TALER_ARL_asession = TALER_ARL_adb->get_session (TALER_ARL_adb->cls);
if (NULL == TALER_ARL_asession)
if (GNUNET_SYSERR ==
TALER_ARL_adb->preflight (TALER_ARL_adb->cls))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Failed to initialize auditor database session.\n");
return GNUNET_DB_STATUS_HARD_ERROR;
}
if (GNUNET_OK !=
TALER_ARL_adb->start (TALER_ARL_adb->cls,
TALER_ARL_asession))
TALER_ARL_adb->start (TALER_ARL_adb->cls))
{
GNUNET_break (0);
return GNUNET_DB_STATUS_HARD_ERROR;
@ -1982,7 +1973,6 @@ begin_transaction (void)
{
wa->qsx = TALER_ARL_adb->get_wire_auditor_account_progress (
TALER_ARL_adb->cls,
TALER_ARL_asession,
&TALER_ARL_master_pub,
wa->ai->section_name,
&wa->pp,
@ -1996,7 +1986,6 @@ begin_transaction (void)
wa->start_pp = wa->pp;
}
qsx_gwap = TALER_ARL_adb->get_wire_auditor_progress (TALER_ARL_adb->cls,
TALER_ARL_asession,
&TALER_ARL_master_pub,
&pp);
if (0 > qsx_gwap)

File diff suppressed because it is too large Load Diff

View File

@ -73,7 +73,6 @@ static void
run (void *cls)
{
struct GNUNET_CONFIGURATION_Handle *cfg = cls;
struct TALER_AUDITORDB_Session *session;
uint64_t rowid;
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
@ -94,16 +93,15 @@ run (void *cls)
result = 77;
goto unload;
}
if (NULL ==
(session = plugin->get_session (plugin->cls)))
if (GNUNET_SYSERR ==
plugin->preflight (plugin->cls))
{
result = 77;
goto drop;
}
FAILIF (GNUNET_OK !=
plugin->start (plugin->cls,
session));
plugin->start (plugin->cls));
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"initializing\n");
@ -164,7 +162,6 @@ run (void *cls)
"Test: auditor_insert_exchange\n");
FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
plugin->insert_exchange (plugin->cls,
session,
&master_pub,
"https://exchange/"));
@ -187,7 +184,6 @@ run (void *cls)
FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
plugin->insert_auditor_progress_coin (plugin->cls,
session,
&master_pub,
&ppc));
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
@ -200,7 +196,6 @@ run (void *cls)
FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
plugin->update_auditor_progress_coin (plugin->cls,
session,
&master_pub,
&ppc));
@ -209,7 +204,6 @@ run (void *cls)
FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
plugin->get_auditor_progress_coin (plugin->cls,
session,
&master_pub,
&ppc2));
FAILIF ( (ppc.last_deposit_serial_id != ppc2.last_deposit_serial_id) ||
@ -233,7 +227,6 @@ run (void *cls)
FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
plugin->insert_reserve_info (plugin->cls,
session,
&reserve_pub,
&master_pub,
&reserve_balance,
@ -246,7 +239,6 @@ run (void *cls)
FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
plugin->update_reserve_info (plugin->cls,
session,
&reserve_pub,
&master_pub,
&reserve_balance,
@ -260,7 +252,6 @@ run (void *cls)
FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
plugin->get_reserve_info (plugin->cls,
session,
&reserve_pub,
&master_pub,
&rowid,
@ -281,7 +272,6 @@ run (void *cls)
FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
plugin->insert_reserve_summary (plugin->cls,
session,
&master_pub,
&withdraw_fee_balance,
&reserve_balance));
@ -291,7 +281,6 @@ run (void *cls)
FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
plugin->update_reserve_summary (plugin->cls,
session,
&master_pub,
&reserve_balance,
&withdraw_fee_balance));
@ -304,7 +293,6 @@ run (void *cls)
FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
plugin->get_reserve_summary (plugin->cls,
session,
&master_pub,
&reserve_balance2,
&withdraw_fee_balance2));
@ -362,7 +350,6 @@ run (void *cls)
FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
plugin->insert_denomination_balance (plugin->cls,
session,
&denom_pub_hash,
&denom_balance,
&denom_loss,
@ -380,7 +367,6 @@ run (void *cls)
FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
plugin->update_denomination_balance (plugin->cls,
session,
&denom_pub_hash,
&denom_balance,
&denom_loss,
@ -392,7 +378,6 @@ run (void *cls)
FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
plugin->get_denomination_balance (plugin->cls,
session,
&denom_pub_hash,
&denom_balance2,
&denom_loss2,
@ -411,7 +396,6 @@ run (void *cls)
FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
plugin->insert_balance_summary (plugin->cls,
session,
&master_pub,
&refund_fee_balance,
&melt_fee_balance,
@ -426,7 +410,6 @@ run (void *cls)
FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
plugin->update_balance_summary (plugin->cls,
session,
&master_pub,
&denom_balance,
&deposit_fee_balance,
@ -449,7 +432,6 @@ run (void *cls)
FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
plugin->get_balance_summary (plugin->cls,
session,
&master_pub,
&denom_balance2,
&deposit_fee_balance2,
@ -480,7 +462,6 @@ run (void *cls)
FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
plugin->insert_historic_denom_revenue (plugin->cls,
session,
&master_pub,
&denom_pub_hash,
past,
@ -489,7 +470,6 @@ run (void *cls)
FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
plugin->insert_historic_denom_revenue (plugin->cls,
session,
&master_pub,
&rnd_hash,
now,
@ -534,7 +514,6 @@ run (void *cls)
FAILIF (0 >=
plugin->select_historic_denom_revenue (plugin->cls,
session,
&master_pub,
&
select_historic_denom_revenue_result,
@ -550,7 +529,6 @@ run (void *cls)
FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
plugin->insert_historic_reserve_revenue (plugin->cls,
session,
&master_pub,
past,
future,
@ -558,7 +536,6 @@ run (void *cls)
FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
plugin->insert_historic_reserve_revenue (plugin->cls,
session,
&master_pub,
now,
future,
@ -598,7 +575,6 @@ run (void *cls)
FAILIF (0 >=
plugin->select_historic_reserve_revenue (plugin->cls,
session,
&master_pub,
select_historic_reserve_revenue_result,
NULL));
@ -608,7 +584,6 @@ run (void *cls)
FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
plugin->insert_predicted_result (plugin->cls,
session,
&master_pub,
&rbalance));
@ -621,18 +596,15 @@ run (void *cls)
FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
plugin->update_predicted_result (plugin->cls,
session,
&master_pub,
&rbalance));
FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
plugin->insert_wire_fee_summary (plugin->cls,
session,
&master_pub,
&rbalance));
FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
plugin->update_wire_fee_summary (plugin->cls,
session,
&master_pub,
&reserve_profits));
{
@ -640,7 +612,6 @@ run (void *cls)
FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
plugin->get_wire_fee_summary (plugin->cls,
session,
&master_pub,
&rprof));
FAILIF (0 !=
@ -648,34 +619,29 @@ run (void *cls)
&reserve_profits));
}
FAILIF (0 >
plugin->commit (plugin->cls,
session));
plugin->commit (plugin->cls));
FAILIF (GNUNET_OK !=
plugin->start (plugin->cls,
session));
plugin->start (plugin->cls));
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Test: get_predicted_balance\n");
FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
plugin->get_predicted_balance (plugin->cls,
session,
&master_pub,
&rbalance2));
FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
plugin->del_reserve_info (plugin->cls,
session,
&reserve_pub,
&master_pub));
FAILIF (0 != TALER_amount_cmp (&rbalance2,
&rbalance));
plugin->rollback (plugin->cls,
session);
plugin->rollback (plugin->cls);
#if GC_IMPLEMENTED
FAILIF (GNUNET_OK !=
@ -685,22 +651,17 @@ run (void *cls)
result = 0;
drop:
if (NULL != session)
{
plugin->rollback (plugin->cls,
session);
plugin->rollback (plugin->cls);
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Test: auditor_delete_exchange\n");
GNUNET_break (GNUNET_OK ==
plugin->start (plugin->cls,
session));
plugin->start (plugin->cls));
GNUNET_break (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT ==
plugin->delete_exchange (plugin->cls,
session,
&master_pub));
GNUNET_break (0 <=
plugin->commit (plugin->cls,
session));
plugin->commit (plugin->cls));
}
GNUNET_break (GNUNET_OK ==
plugin->drop_tables (plugin->cls,

View File

@ -344,9 +344,7 @@ static struct TEH_KeyStateHandle *key_state;
/**
* Counter incremented whenever we have a reason to re-build the keys because
* something external changed (in another thread). The counter is manipulated
* using an atomic update, and thus to ensure that threads notice when it
* changes, the variable MUST be volatile. See #TEH_keys_get_state() and
* something external changed (in another thread). See #TEH_keys_get_state() and
* #TEH_keys_update_states() for uses of this variable.
*/
static uint64_t key_generation;
@ -1721,8 +1719,7 @@ build_key_state (struct HelperState *hs,
void
TEH_keys_update_states ()
{
__sync_fetch_and_add (&key_generation,
1);
key_generation++;
TEH_resume_keys_requests (false);
}

View File

@ -1,6 +1,6 @@
/*
This file is part of TALER
Copyright (C) 2014-2018 Taler Systems SA
Copyright (C) 2014-2021 Taler Systems SA
TALER is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
@ -356,12 +356,6 @@ typedef int
const struct TALER_AUDITORDB_DepositConfirmation *dc);
/**
* Handle for one session with the database.
*/
struct TALER_AUDITORDB_Session;
/**
* @brief The plugin API, returned from the plugin's "init" function.
* The argument given to "init" is simply a configuration handle.
@ -384,14 +378,16 @@ struct TALER_AUDITORDB_Plugin
char *library_name;
/**
* Get the thread-local database-handle.
* Connect to the db if the connection does not exist yet.
* Fully connect to the db if the connection does not exist yet
* and check that there is no transaction currently running.
*
* @param cls the @e cls of this struct with the plugin-specific state
* @param the database connection, or NULL on error
* @return #GNUNET_OK on success
* #GNUNET_NO if we rolled back an earlier transaction
* #GNUNET_SYSERR if we have no DB connection
*/
struct TALER_AUDITORDB_Session *
(*get_session) (void *cls);
enum GNUNET_GenericReturnValue
(*preflight)(void *cls);
/**
@ -405,8 +401,8 @@ struct TALER_AUDITORDB_Plugin
* used when restarting the auditor
* @return #GNUNET_OK upon success; #GNUNET_SYSERR upon failure
*/
int
(*drop_tables) (void *cls,
enum GNUNET_GenericReturnValue
(*drop_tables)(void *cls,
int drop_exchangelist);
@ -416,43 +412,37 @@ struct TALER_AUDITORDB_Plugin
* @param cls the @e cls of this struct with the plugin-specific state
* @return #GNUNET_OK upon success; #GNUNET_SYSERR upon failure
*/
int
(*create_tables) (void *cls);
enum GNUNET_GenericReturnValue
(*create_tables)(void *cls);
/**
* Start a transaction.
*
* @param cls the @e cls of this struct with the plugin-specific state
* @param session connection to use
* @return #GNUNET_OK on success
*/
int
(*start) (void *cls,
struct TALER_AUDITORDB_Session *session);
enum GNUNET_GenericReturnValue
(*start)(void *cls);
/**
* Commit a transaction.
*
* @param cls the @e cls of this struct with the plugin-specific state
* @param session connection to use
* @return transaction status code
*/
enum GNUNET_DB_QueryStatus
(*commit)(void *cls,
struct TALER_AUDITORDB_Session *session);
(*commit)(void *cls);
/**
* Abort/rollback a transaction.
*
* @param cls the @e cls of this struct with the plugin-specific state
* @param session connection to use
*/
void
(*rollback) (void *cls,
struct TALER_AUDITORDB_Session *session);
(*rollback) (void *cls);
/**
@ -471,14 +461,12 @@ struct TALER_AUDITORDB_Plugin
* Insert information about an exchange this auditor will be auditing.
*
* @param cls the @e cls of this struct with the plugin-specific state
* @param session connection to the database
* @param master_pub master public key of the exchange
* @param exchange_url public (base) URL of the API of the exchange
* @return query result status
*/
enum GNUNET_DB_QueryStatus
(*insert_exchange)(void *cls,
struct TALER_AUDITORDB_Session *session,
const struct TALER_MasterPublicKeyP *master_pub,
const char *exchange_url);
@ -489,13 +477,11 @@ struct TALER_AUDITORDB_Plugin
* to this exchange!
*
* @param cls the @e cls of this struct with the plugin-specific state
* @param session connection to the database
* @param master_pub master public key of the exchange
* @return query result status
*/
enum GNUNET_DB_QueryStatus
(*delete_exchange)(void *cls,
struct TALER_AUDITORDB_Session *session,
const struct TALER_MasterPublicKeyP *master_pub);
@ -503,14 +489,12 @@ struct TALER_AUDITORDB_Plugin
* Obtain information about exchanges this auditor is auditing.
*
* @param cls the @e cls of this struct with the plugin-specific state
* @param session connection to the database
* @param cb function to call with the results
* @param cb_cls closure for @a cb
* @return query result status
*/
enum GNUNET_DB_QueryStatus
(*list_exchanges)(void *cls,
struct TALER_AUDITORDB_Session *session,
TALER_AUDITORDB_ExchangeCallback cb,
void *cb_cls);
@ -518,14 +502,12 @@ struct TALER_AUDITORDB_Plugin
* Insert information about a signing key of the exchange.
*
* @param cls the @e cls of this struct with the plugin-specific state
* @param session connection to the database
* @param sk signing key information to store
* @return query result status
*/
enum GNUNET_DB_QueryStatus
(*insert_exchange_signkey)(
void *cls,
struct TALER_AUDITORDB_Session *session,
const struct TALER_AUDITORDB_ExchangeSigningKey *sk);
@ -533,14 +515,12 @@ struct TALER_AUDITORDB_Plugin
* Insert information about a deposit confirmation into the database.
*
* @param cls the @e cls of this struct with the plugin-specific state
* @param session connection to the database
* @param dc deposit confirmation information to store
* @return query result status
*/
enum GNUNET_DB_QueryStatus
(*insert_deposit_confirmation)(
void *cls,
struct TALER_AUDITORDB_Session *session,
const struct TALER_AUDITORDB_DepositConfirmation *dc);
@ -548,7 +528,6 @@ struct TALER_AUDITORDB_Plugin
* Get information about deposit confirmations from the database.
*
* @param cls the @e cls of this struct with the plugin-specific state
* @param session connection to the database
* @param master_public_key for which exchange do we want to get deposit confirmations
* @param start_id row/serial ID where to start the iteration (0 from
* the start, exclusive, i.e. serial_ids must start from 1)
@ -559,7 +538,6 @@ struct TALER_AUDITORDB_Plugin
enum GNUNET_DB_QueryStatus
(*get_deposit_confirmations)(
void *cls,
struct TALER_AUDITORDB_Session *session,
const struct TALER_MasterPublicKeyP *master_public_key,
uint64_t start_id,
TALER_AUDITORDB_DepositConfirmationCallback cb,
@ -571,7 +549,6 @@ struct TALER_AUDITORDB_Plugin
* data.
*
* @param cls the @e cls of this struct with the plugin-specific state
* @param session connection to use
* @param master_pub master key of the exchange
* @param ppc where is the auditor in processing
* @return transaction status code
@ -579,7 +556,6 @@ struct TALER_AUDITORDB_Plugin
enum GNUNET_DB_QueryStatus
(*insert_auditor_progress_coin)(
void *cls,
struct TALER_AUDITORDB_Session *session,
const struct TALER_MasterPublicKeyP *master_pub,
const struct TALER_AUDITORDB_ProgressPointCoin *ppc);
@ -589,7 +565,6 @@ struct TALER_AUDITORDB_Plugin
* must be an existing record for the exchange.
*
* @param cls the @e cls of this struct with the plugin-specific state
* @param session connection to use
* @param master_pub master key of the exchange
* @param ppc where is the auditor in processing
* @return transaction status code
@ -597,7 +572,6 @@ struct TALER_AUDITORDB_Plugin
enum GNUNET_DB_QueryStatus
(*update_auditor_progress_coin)(
void *cls,
struct TALER_AUDITORDB_Session *session,
const struct TALER_MasterPublicKeyP *master_pub,
const struct TALER_AUDITORDB_ProgressPointCoin *ppc);
@ -606,14 +580,12 @@ struct TALER_AUDITORDB_Plugin
* Get information about the progress of the auditor.
*
* @param cls the @e cls of this struct with the plugin-specific state
* @param session connection to use
* @param master_pub master key of the exchange
* @param[out] ppc set to where the auditor is in processing
* @return transaction status code
*/
enum GNUNET_DB_QueryStatus
(*get_auditor_progress_coin)(void *cls,
struct TALER_AUDITORDB_Session *session,
const struct TALER_MasterPublicKeyP *master_pub,
struct TALER_AUDITORDB_ProgressPointCoin *ppc);
@ -622,7 +594,6 @@ struct TALER_AUDITORDB_Plugin
* data.
*
* @param cls the @e cls of this struct with the plugin-specific state
* @param session connection to use
* @param master_pub master key of the exchange
* @param ppr where is the auditor in processing
* @return transaction status code
@ -630,7 +601,6 @@ struct TALER_AUDITORDB_Plugin
enum GNUNET_DB_QueryStatus
(*insert_auditor_progress_reserve)(
void *cls,
struct TALER_AUDITORDB_Session *session,
const struct TALER_MasterPublicKeyP *master_pub,
const struct TALER_AUDITORDB_ProgressPointReserve *ppr);
@ -640,7 +610,6 @@ struct TALER_AUDITORDB_Plugin
* must be an existing record for the exchange.
*
* @param cls the @e cls of this struct with the plugin-specific state
* @param session connection to use
* @param master_pub master key of the exchange
* @param ppr where is the auditor in processing
* @return transaction status code
@ -648,7 +617,6 @@ struct TALER_AUDITORDB_Plugin
enum GNUNET_DB_QueryStatus
(*update_auditor_progress_reserve)(
void *cls,
struct TALER_AUDITORDB_Session *session,
const struct TALER_MasterPublicKeyP *master_pub,
const struct TALER_AUDITORDB_ProgressPointReserve *ppr);
@ -657,7 +625,6 @@ struct TALER_AUDITORDB_Plugin
* Get information about the progress of the auditor.
*
* @param cls the @e cls of this struct with the plugin-specific state
* @param session connection to use
* @param master_pub master key of the exchange
* @param[out] ppr set to where the auditor is in processing
* @return transaction status code
@ -665,7 +632,6 @@ struct TALER_AUDITORDB_Plugin
enum GNUNET_DB_QueryStatus
(*get_auditor_progress_reserve)(
void *cls,
struct TALER_AUDITORDB_Session *session,
const struct TALER_MasterPublicKeyP *master_pub,
struct TALER_AUDITORDB_ProgressPointReserve *ppr);
@ -674,7 +640,6 @@ struct TALER_AUDITORDB_Plugin
* data.
*
* @param cls the @e cls of this struct with the plugin-specific state
* @param session connection to use
* @param master_pub master key of the exchange
* @param ppdc where is the auditor in processing
* @return transaction status code
@ -682,7 +647,6 @@ struct TALER_AUDITORDB_Plugin
enum GNUNET_DB_QueryStatus
(*insert_auditor_progress_deposit_confirmation)(
void *cls,
struct TALER_AUDITORDB_Session *session,
const struct TALER_MasterPublicKeyP *master_pub,
const struct TALER_AUDITORDB_ProgressPointDepositConfirmation *ppdc);
@ -692,7 +656,6 @@ struct TALER_AUDITORDB_Plugin
* must be an existing record for the exchange.
*
* @param cls the @e cls of this struct with the plugin-specific state
* @param session connection to use
* @param master_pub master key of the exchange
* @param ppdc where is the auditor in processing
* @return transaction status code
@ -700,7 +663,6 @@ struct TALER_AUDITORDB_Plugin
enum GNUNET_DB_QueryStatus
(*update_auditor_progress_deposit_confirmation)(
void *cls,
struct TALER_AUDITORDB_Session *session,
const struct TALER_MasterPublicKeyP *master_pub,
const struct TALER_AUDITORDB_ProgressPointDepositConfirmation *ppdc);
@ -709,7 +671,6 @@ struct TALER_AUDITORDB_Plugin
* Get information about the progress of the auditor.
*
* @param cls the @e cls of this struct with the plugin-specific state
* @param session connection to use
* @param master_pub master key of the exchange
* @param[out] ppdc set to where the auditor is in processing
* @return transaction status code
@ -717,7 +678,6 @@ struct TALER_AUDITORDB_Plugin
enum GNUNET_DB_QueryStatus
(*get_auditor_progress_deposit_confirmation)(
void *cls,
struct TALER_AUDITORDB_Session *session,
const struct TALER_MasterPublicKeyP *master_pub,
struct TALER_AUDITORDB_ProgressPointDepositConfirmation *ppdc);
@ -727,7 +687,6 @@ struct TALER_AUDITORDB_Plugin
* data.
*
* @param cls the @e cls of this struct with the plugin-specific state
* @param session connection to use
* @param master_pub master key of the exchange
* @param ppa where is the auditor in processing
* @return transaction status code
@ -735,7 +694,6 @@ struct TALER_AUDITORDB_Plugin
enum GNUNET_DB_QueryStatus
(*insert_auditor_progress_aggregation)(
void *cls,
struct TALER_AUDITORDB_Session *session,
const struct TALER_MasterPublicKeyP *master_pub,
const struct TALER_AUDITORDB_ProgressPointAggregation *ppa);
@ -745,7 +703,6 @@ struct TALER_AUDITORDB_Plugin
* must be an existing record for the exchange.
*
* @param cls the @e cls of this struct with the plugin-specific state
* @param session connection to use
* @param master_pub master key of the exchange
* @param ppa where is the auditor in processing
* @return transaction status code
@ -753,7 +710,6 @@ struct TALER_AUDITORDB_Plugin
enum GNUNET_DB_QueryStatus
(*update_auditor_progress_aggregation)(
void *cls,
struct TALER_AUDITORDB_Session *session,
const struct TALER_MasterPublicKeyP *master_pub,
const struct TALER_AUDITORDB_ProgressPointAggregation *ppa);
@ -762,7 +718,6 @@ struct TALER_AUDITORDB_Plugin
* Get information about the progress of the auditor.
*
* @param cls the @e cls of this struct with the plugin-specific state
* @param session connection to use
* @param master_pub master key of the exchange
* @param[out] ppa set to where the auditor is in processing
* @return transaction status code
@ -770,7 +725,6 @@ struct TALER_AUDITORDB_Plugin
enum GNUNET_DB_QueryStatus
(*get_auditor_progress_aggregation)(
void *cls,
struct TALER_AUDITORDB_Session *session,
const struct TALER_MasterPublicKeyP *master_pub,
struct TALER_AUDITORDB_ProgressPointAggregation *ppa);
@ -780,7 +734,6 @@ struct TALER_AUDITORDB_Plugin
* data.
*
* @param cls the @e cls of this struct with the plugin-specific state
* @param session connection to use
* @param master_pub master key of the exchange
* @param account_name name of the wire account we are auditing
* @param pp where is the auditor in processing
@ -791,7 +744,6 @@ struct TALER_AUDITORDB_Plugin
enum GNUNET_DB_QueryStatus
(*insert_wire_auditor_account_progress)(
void *cls,
struct TALER_AUDITORDB_Session *session,
const struct TALER_MasterPublicKeyP *master_pub,
const char *account_name,
const struct TALER_AUDITORDB_WireAccountProgressPoint *pp,
@ -804,7 +756,6 @@ struct TALER_AUDITORDB_Plugin
* must be an existing record for the exchange.
*
* @param cls the @e cls of this struct with the plugin-specific state
* @param session connection to use
* @param master_pub master key of the exchange
* @param account_name name of the wire account we are auditing
* @param pp where is the auditor in processing
@ -815,7 +766,6 @@ struct TALER_AUDITORDB_Plugin
enum GNUNET_DB_QueryStatus
(*update_wire_auditor_account_progress)(
void *cls,
struct TALER_AUDITORDB_Session *session,
const struct TALER_MasterPublicKeyP *master_pub,
const char *account_name,
const struct TALER_AUDITORDB_WireAccountProgressPoint *pp,
@ -827,7 +777,6 @@ struct TALER_AUDITORDB_Plugin
* Get information about the progress of the wire auditor.
*
* @param cls the @e cls of this struct with the plugin-specific state
* @param session connection to use
* @param master_pub master key of the exchange
* @param account_name name of the wire account we are auditing
* @param[out] pp where is the auditor in processing
@ -838,7 +787,6 @@ struct TALER_AUDITORDB_Plugin
enum GNUNET_DB_QueryStatus
(*get_wire_auditor_account_progress)(
void *cls,
struct TALER_AUDITORDB_Session *session,
const struct TALER_MasterPublicKeyP *master_pub,
const char *account_name,
struct TALER_AUDITORDB_WireAccountProgressPoint *pp,
@ -851,7 +799,6 @@ struct TALER_AUDITORDB_Plugin
* data.
*
* @param cls the @e cls of this struct with the plugin-specific state
* @param session connection to use
* @param master_pub master key of the exchange
* @param account_name name of the wire account we are auditing
* @param pp where is the auditor in processing
@ -860,7 +807,6 @@ struct TALER_AUDITORDB_Plugin
enum GNUNET_DB_QueryStatus
(*insert_wire_auditor_progress)(
void *cls,
struct TALER_AUDITORDB_Session *session,
const struct TALER_MasterPublicKeyP *master_pub,
const struct TALER_AUDITORDB_WireProgressPoint *pp);
@ -870,7 +816,6 @@ struct TALER_AUDITORDB_Plugin
* must be an existing record for the exchange.
*
* @param cls the @e cls of this struct with the plugin-specific state
* @param session connection to use
* @param master_pub master key of the exchange
* @param account_name name of the wire account we are auditing
* @param pp where is the auditor in processing
@ -879,7 +824,6 @@ struct TALER_AUDITORDB_Plugin
enum GNUNET_DB_QueryStatus
(*update_wire_auditor_progress)(
void *cls,
struct TALER_AUDITORDB_Session *session,
const struct TALER_MasterPublicKeyP *master_pub,
const struct TALER_AUDITORDB_WireProgressPoint *pp);
@ -888,7 +832,6 @@ struct TALER_AUDITORDB_Plugin
* Get information about the progress of the wire auditor.
*
* @param cls the @e cls of this struct with the plugin-specific state
* @param session connection to use
* @param master_pub master key of the exchange
* @param account_name name of the wire account we are auditing
* @param[out] pp set to where the auditor is in processing
@ -896,7 +839,6 @@ struct TALER_AUDITORDB_Plugin
*/
enum GNUNET_DB_QueryStatus
(*get_wire_auditor_progress)(void *cls,
struct TALER_AUDITORDB_Session *session,
const struct TALER_MasterPublicKeyP *master_pub,
struct TALER_AUDITORDB_WireProgressPoint *pp);
@ -906,7 +848,6 @@ struct TALER_AUDITORDB_Plugin
* existing record for the reserve.
*
* @param cls the @e cls of this struct with the plugin-specific state
* @param session connection to use
* @param reserve_pub public key of the reserve
* @param master_pub master public key of the exchange
* @param reserve_balance amount stored in the reserve
@ -918,7 +859,6 @@ struct TALER_AUDITORDB_Plugin
*/
enum GNUNET_DB_QueryStatus
(*insert_reserve_info)(void *cls,
struct TALER_AUDITORDB_Session *session,
const struct TALER_ReservePublicKeyP *reserve_pub,
const struct TALER_MasterPublicKeyP *master_pub,
const struct TALER_Amount *reserve_balance,
@ -932,7 +872,6 @@ struct TALER_AUDITORDB_Plugin
* existing record, which must already exist.
*
* @param cls the @e cls of this struct with the plugin-specific state
* @param session connection to use
* @param reserve_pub public key of the reserve
* @param master_pub master public key of the exchange
* @param reserve_balance amount stored in the reserve
@ -943,7 +882,6 @@ struct TALER_AUDITORDB_Plugin
*/
enum GNUNET_DB_QueryStatus
(*update_reserve_info)(void *cls,
struct TALER_AUDITORDB_Session *session,
const struct TALER_ReservePublicKeyP *reserve_pub,
const struct TALER_MasterPublicKeyP *master_pub,
const struct TALER_Amount *reserve_balance,
@ -955,7 +893,6 @@ struct TALER_AUDITORDB_Plugin
* Get information about a reserve.
*
* @param cls the @e cls of this struct with the plugin-specific state
* @param session connection to use
* @param reserve_pub public key of the reserve
* @param master_pub master public key of the exchange
* @param[out] rowid which row did we get the information from
@ -968,7 +905,6 @@ struct TALER_AUDITORDB_Plugin
*/
enum GNUNET_DB_QueryStatus
(*get_reserve_info)(void *cls,
struct TALER_AUDITORDB_Session *session,
const struct TALER_ReservePublicKeyP *reserve_pub,
const struct TALER_MasterPublicKeyP *master_pub,
uint64_t *rowid,
@ -982,14 +918,12 @@ struct TALER_AUDITORDB_Plugin
* Delete information about a reserve.
*
* @param cls the @e cls of this struct with the plugin-specific state
* @param session connection to use
* @param reserve_pub public key of the reserve
* @param master_pub master public key of the exchange
* @return transaction status code
*/
enum GNUNET_DB_QueryStatus
(*del_reserve_info)(void *cls,
struct TALER_AUDITORDB_Session *session,
const struct TALER_ReservePublicKeyP *reserve_pub,
const struct TALER_MasterPublicKeyP *master_pub);
@ -999,7 +933,6 @@ struct TALER_AUDITORDB_Plugin
* existing record for the @a master_pub.
*
* @param cls the @e cls of this struct with the plugin-specific state
* @param session connection to use
* @param master_pub master public key of the exchange
* @param reserve_balance amount stored in the reserve
* @param withdraw_fee_balance amount the exchange gained in withdraw fees
@ -1008,7 +941,6 @@ struct TALER_AUDITORDB_Plugin
*/
enum GNUNET_DB_QueryStatus
(*insert_reserve_summary)(void *cls,
struct TALER_AUDITORDB_Session *session,
const struct TALER_MasterPublicKeyP *master_pub,
const struct TALER_Amount *reserve_balance,
const struct TALER_Amount *withdraw_fee_balance);
@ -1019,7 +951,6 @@ struct TALER_AUDITORDB_Plugin
* existing record, which must already exist.
*
* @param cls the @e cls of this struct with the plugin-specific state
* @param session connection to use
* @param master_pub master public key of the exchange
* @param reserve_balance amount stored in the reserve
* @param withdraw_fee_balance amount the exchange gained in withdraw fees
@ -1028,7 +959,6 @@ struct TALER_AUDITORDB_Plugin
*/
enum GNUNET_DB_QueryStatus
(*update_reserve_summary)(void *cls,
struct TALER_AUDITORDB_Session *session,
const struct TALER_MasterPublicKeyP *master_pub,
const struct TALER_Amount *reserve_balance,
const struct TALER_Amount *withdraw_fee_balance);
@ -1038,7 +968,6 @@ struct TALER_AUDITORDB_Plugin
* Get summary information about all reserves.
*
* @param cls the @e cls of this struct with the plugin-specific state
* @param session connection to use
* @param master_pub master public key of the exchange
* @param[out] reserve_balance amount stored in the reserve
* @param[out] withdraw_fee_balance amount the exchange gained in withdraw fees
@ -1047,7 +976,6 @@ struct TALER_AUDITORDB_Plugin
*/
enum GNUNET_DB_QueryStatus
(*get_reserve_summary)(void *cls,
struct TALER_AUDITORDB_Session *session,
const struct TALER_MasterPublicKeyP *master_pub,
struct TALER_Amount *reserve_balance,
struct TALER_Amount *withdraw_fee_balance);
@ -1058,14 +986,12 @@ struct TALER_AUDITORDB_Plugin
* existing record for the same @a master_pub.
*
* @param cls the @e cls of this struct with the plugin-specific state
* @param session connection to use
* @param master_pub master public key of the exchange
* @param wire_fee_balance amount the exchange gained in wire fees
* @return transaction status code
*/
enum GNUNET_DB_QueryStatus
(*insert_wire_fee_summary)(void *cls,
struct TALER_AUDITORDB_Session *session,
const struct TALER_MasterPublicKeyP *master_pub,
const struct TALER_Amount *wire_fee_balance);
@ -1075,14 +1001,12 @@ struct TALER_AUDITORDB_Plugin
* existing record, which must already exist.
*
* @param cls the @e cls of this struct with the plugin-specific state
* @param session connection to use
* @param master_pub master public key of the exchange
* @param wire_fee_balance amount the exchange gained in wire fees
* @return transaction status code
*/
enum GNUNET_DB_QueryStatus
(*update_wire_fee_summary)(void *cls,
struct TALER_AUDITORDB_Session *session,
const struct TALER_MasterPublicKeyP *master_pub,
const struct TALER_Amount *wire_fee_balance);
@ -1091,14 +1015,12 @@ struct TALER_AUDITORDB_Plugin
* Get summary information about an exchanges wire fee balance.
*
* @param cls the @e cls of this struct with the plugin-specific state
* @param session connection to use
* @param master_pub master public key of the exchange
* @param[out] wire_fee_balance set amount the exchange gained in wire fees
* @return transaction status code
*/
enum GNUNET_DB_QueryStatus
(*get_wire_fee_summary)(void *cls,
struct TALER_AUDITORDB_Session *session,
const struct TALER_MasterPublicKeyP *master_pub,
struct TALER_Amount *wire_fee_balance);
@ -1108,7 +1030,6 @@ struct TALER_AUDITORDB_Plugin
* must not be an existing record for the denomination key.
*
* @param cls the @e cls of this struct with the plugin-specific state
* @param session connection to use
* @param denom_pub_hash hash of the denomination public key
* @param denom_balance value of coins outstanding with this denomination key
* @param denom_loss value of coins redeemed that were not outstanding (effectively, negative @a denom_balance)
@ -1119,7 +1040,6 @@ struct TALER_AUDITORDB_Plugin
*/
enum GNUNET_DB_QueryStatus
(*insert_denomination_balance)(void *cls,
struct TALER_AUDITORDB_Session *session,
const struct GNUNET_HashCode *denom_pub_hash,
const struct TALER_Amount *denom_balance,
const struct TALER_Amount *denom_loss,
@ -1133,7 +1053,6 @@ struct TALER_AUDITORDB_Plugin
* must be an existing record for the denomination key.
*
* @param cls the @e cls of this struct with the plugin-specific state
* @param session connection to use
* @param denom_pub_hash hash of the denomination public key
* @param denom_balance value of coins outstanding with this denomination key
* @param denom_loss value of coins redeemed that were not outstanding (effectively, negative @a denom_balance)
@ -1144,7 +1063,6 @@ struct TALER_AUDITORDB_Plugin
*/
enum GNUNET_DB_QueryStatus
(*update_denomination_balance)(void *cls,
struct TALER_AUDITORDB_Session *session,
const struct GNUNET_HashCode *denom_pub_hash,
const struct TALER_Amount *denom_balance,
const struct TALER_Amount *denom_loss,
@ -1157,7 +1075,6 @@ struct TALER_AUDITORDB_Plugin
* Get information about a denomination key's balances.
*
* @param cls the @e cls of this struct with the plugin-specific state
* @param session connection to use
* @param denom_pub_hash hash of the denomination public key
* @param[out] denom_balance value of coins outstanding with this denomination key
* @param[out] denom_loss value of coins redeemed that were not outstanding (effectively, negative @a denom_balance)
@ -1168,7 +1085,6 @@ struct TALER_AUDITORDB_Plugin
*/
enum GNUNET_DB_QueryStatus
(*get_denomination_balance)(void *cls,
struct TALER_AUDITORDB_Session *session,
const struct GNUNET_HashCode *denom_pub_hash,
struct TALER_Amount *denom_balance,
struct TALER_Amount *denom_loss,
@ -1181,13 +1097,11 @@ struct TALER_AUDITORDB_Plugin
* Delete information about a denomination key's balances.
*
* @param cls the @e cls of this struct with the plugin-specific state
* @param session connection to use
* @param denom_pub_hash hash of the denomination public key
* @return transaction status code
*/
enum GNUNET_DB_QueryStatus
(*del_denomination_balance)(void *cls,
struct TALER_AUDITORDB_Session *session,
const struct GNUNET_HashCode *denom_pub_hash);
@ -1196,7 +1110,6 @@ struct TALER_AUDITORDB_Plugin
* must not be an existing record for the exchange.
*
* @param cls the @e cls of this struct with the plugin-specific state
* @param session connection to use
* @param master_pub master key of the exchange
* @param denom_balance value of coins outstanding with this denomination key
* @param deposit_fee_balance total deposit fees collected for this DK
@ -1210,7 +1123,6 @@ struct TALER_AUDITORDB_Plugin
*/
enum GNUNET_DB_QueryStatus
(*insert_balance_summary)(void *cls,
struct TALER_AUDITORDB_Session *session,
const struct TALER_MasterPublicKeyP *master_pub,
const struct TALER_Amount *denom_balance,
const struct TALER_Amount *deposit_fee_balance,
@ -1226,7 +1138,6 @@ struct TALER_AUDITORDB_Plugin
* must be an existing record for the exchange.
*
* @param cls the @e cls of this struct with the plugin-specific state
* @param session connection to use
* @param master_pub master key of the exchange
* @param denom_balance value of coins outstanding with this denomination key
* @param deposit_fee_balance total deposit fees collected for this DK
@ -1240,7 +1151,6 @@ struct TALER_AUDITORDB_Plugin
*/
enum GNUNET_DB_QueryStatus
(*update_balance_summary)(void *cls,
struct TALER_AUDITORDB_Session *session,
const struct TALER_MasterPublicKeyP *master_pub,
const struct TALER_Amount *denom_balance,
const struct TALER_Amount *deposit_fee_balance,
@ -1255,7 +1165,6 @@ struct TALER_AUDITORDB_Plugin
* Get information about an exchange's denomination balances.
*
* @param cls the @e cls of this struct with the plugin-specific state
* @param session connection to use
* @param master_pub master key of the exchange
* @param[out] denom_balance value of coins outstanding with this denomination key
* @param[out] deposit_fee_balance total deposit fees collected for this DK
@ -1269,7 +1178,6 @@ struct TALER_AUDITORDB_Plugin
*/
enum GNUNET_DB_QueryStatus
(*get_balance_summary)(void *cls,
struct TALER_AUDITORDB_Session *session,
const struct TALER_MasterPublicKeyP *master_pub,
struct TALER_Amount *denom_balance,
struct TALER_Amount *deposit_fee_balance,
@ -1285,7 +1193,6 @@ struct TALER_AUDITORDB_Plugin
* revenue about a denomination key.
*
* @param cls the @e cls of this struct with the plugin-specific state
* @param session connection to use
* @param master_pub master key of the exchange
* @param denom_pub_hash hash of the denomination key
* @param revenue_timestamp when did this profit get realized
@ -1298,7 +1205,6 @@ struct TALER_AUDITORDB_Plugin
enum GNUNET_DB_QueryStatus
(*insert_historic_denom_revenue)(
void *cls,
struct TALER_AUDITORDB_Session *session,
const struct TALER_MasterPublicKeyP *master_pub,
const struct GNUNET_HashCode *denom_pub_hash,
struct GNUNET_TIME_Absolute revenue_timestamp,
@ -1311,7 +1217,6 @@ struct TALER_AUDITORDB_Plugin
* of the given @a master_pub.
*
* @param cls the @e cls of this struct with the plugin-specific state
* @param session connection to use
* @param master_pub master key of the exchange
* @param cb function to call with the results
* @param cb_cls closure for @a cb
@ -1320,7 +1225,6 @@ struct TALER_AUDITORDB_Plugin
enum GNUNET_DB_QueryStatus
(*select_historic_denom_revenue)(
void *cls,
struct TALER_AUDITORDB_Session *session,
const struct TALER_MasterPublicKeyP *master_pub,
TALER_AUDITORDB_HistoricDenominationRevenueDataCallback cb,
void *cb_cls);
@ -1330,7 +1234,6 @@ struct TALER_AUDITORDB_Plugin
* Insert information about an exchange's historic revenue from reserves.
*
* @param cls the @e cls of this struct with the plugin-specific state
* @param session connection to use
* @param master_pub master key of the exchange
* @param start_time beginning of aggregated time interval
* @param end_time end of aggregated time interval
@ -1340,7 +1243,6 @@ struct TALER_AUDITORDB_Plugin
enum GNUNET_DB_QueryStatus
(*insert_historic_reserve_revenue)(
void *cls,
struct TALER_AUDITORDB_Session *session,
const struct TALER_MasterPublicKeyP *master_pub,
struct GNUNET_TIME_Absolute start_time,
struct GNUNET_TIME_Absolute end_time,
@ -1351,7 +1253,6 @@ struct TALER_AUDITORDB_Plugin
* Return information about an exchange's historic revenue from reserves.
*
* @param cls the @e cls of this struct with the plugin-specific state
* @param session connection to use
* @param master_pub master key of the exchange
* @param cb function to call with results
* @param cb_cls closure for @a cb
@ -1360,7 +1261,6 @@ struct TALER_AUDITORDB_Plugin
enum GNUNET_DB_QueryStatus
(*select_historic_reserve_revenue)(
void *cls,
struct TALER_AUDITORDB_Session *session,
const struct TALER_MasterPublicKeyP *master_pub,
TALER_AUDITORDB_HistoricReserveRevenueDataCallback cb,
void *cb_cls);
@ -1371,14 +1271,12 @@ struct TALER_AUDITORDB_Plugin
* account balance.
*
* @param cls the @e cls of this struct with the plugin-specific state
* @param session connection to use
* @param master_pub master key of the exchange
* @param balance what the bank account balance of the exchange should show
* @return transaction status code
*/
enum GNUNET_DB_QueryStatus
(*insert_predicted_result)(void *cls,
struct TALER_AUDITORDB_Session *session,
const struct TALER_MasterPublicKeyP *master_pub,
const struct TALER_Amount *balance);
@ -1388,14 +1286,12 @@ struct TALER_AUDITORDB_Plugin
* must be an existing record for the exchange.
*
* @param cls the @e cls of this struct with the plugin-specific state
* @param session connection to use
* @param master_pub master key of the exchange
* @param balance what the bank account balance of the exchange should show
* @return transaction status code
*/
enum GNUNET_DB_QueryStatus
(*update_predicted_result)(void *cls,
struct TALER_AUDITORDB_Session *session,
const struct TALER_MasterPublicKeyP *master_pub,
const struct TALER_Amount *balance);
@ -1404,14 +1300,12 @@ struct TALER_AUDITORDB_Plugin
* Get an exchange's predicted balance.
*
* @param cls the @e cls of this struct with the plugin-specific state
* @param session connection to use
* @param master_pub master key of the exchange
* @param[out] balance expected bank account balance of the exchange
* @return transaction status code
*/
enum GNUNET_DB_QueryStatus
(*get_predicted_balance)(void *cls,
struct TALER_AUDITORDB_Session *session,
const struct TALER_MasterPublicKeyP *master_pub,
struct TALER_Amount *balance);

View File

@ -255,6 +255,7 @@ TALER_MHD_open_unix_path (const char *unix_path,
GNUNET_free (un);
return -1;
}
if (GNUNET_OK !=
GNUNET_NETWORK_socket_bind (nh,
(void *) un,
@ -446,6 +447,18 @@ TALER_MHD_bind (const struct GNUNET_CONFIGURATION_Handle *cfg,
freeaddrinfo (res);
return -1;
}
{
const int on = 1;
if (GNUNET_OK !=
GNUNET_NETWORK_socket_setsockopt (nh,
SOL_SOCKET,
SO_REUSEPORT,
&on,
sizeof(on)))
GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING,
"setsockopt");
}
if (GNUNET_OK !=
GNUNET_NETWORK_socket_bind (nh,
res->ai_addr,

View File

@ -46,6 +46,8 @@ main (int argc,
GNUNET_log_setup ("test-payto",
"WARNING",
NULL);
GNUNET_assert (NULL ==
TALER_iban_validate ("FR1420041010050500013M02606"));
r = TALER_xtalerbank_account_from_payto (
"payto://x-taler-bank/localhost:1080/alice");
CHECK ("alice",