make reserve balance check used in internal_auditor mode only
This commit is contained in:
parent
9d5a3ef659
commit
6ccda0b02e
@ -1026,7 +1026,6 @@ verify_reserve_balance (void *cls,
|
||||
{
|
||||
struct ReserveContext *rc = cls;
|
||||
struct ReserveSummary *rs = value;
|
||||
struct TALER_EXCHANGEDB_Reserve reserve;
|
||||
struct TALER_Amount balance;
|
||||
struct TALER_Amount nbalance;
|
||||
enum GNUNET_DB_QueryStatus qs;
|
||||
@ -1063,8 +1062,14 @@ verify_reserve_balance (void *cls,
|
||||
&nbalance));
|
||||
}
|
||||
|
||||
if (internal_checks)
|
||||
{
|
||||
/* Now check OUR balance calculation vs. the one the exchange has
|
||||
in its database */
|
||||
in its database. This can only be done when we are doing an
|
||||
internal audit, as otherwise the balance of the 'reserves' table
|
||||
is not replicated at the auditor. */
|
||||
struct TALER_EXCHANGEDB_Reserve reserve;
|
||||
|
||||
reserve.pub = rs->reserve_pub;
|
||||
qs = TALER_ARL_edb->reserves_get (TALER_ARL_edb->cls,
|
||||
TALER_ARL_esession,
|
||||
@ -1080,7 +1085,8 @@ verify_reserve_balance (void *cls,
|
||||
TALER_ARL_report (report_reserve_balance_insufficient_inconsistencies,
|
||||
json_pack ("{s:o, s:o}",
|
||||
"reserve_pub",
|
||||
GNUNET_JSON_from_data_auto (&rs->reserve_pub),
|
||||
GNUNET_JSON_from_data_auto (
|
||||
&rs->reserve_pub),
|
||||
"gain",
|
||||
TALER_JSON_from_amount (&nbalance)));
|
||||
if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == qs)
|
||||
@ -1130,6 +1136,7 @@ verify_reserve_balance (void *cls,
|
||||
TALER_JSON_from_amount (&nbalance)));
|
||||
}
|
||||
}
|
||||
} /* end of 'if (internal_checks)' */
|
||||
|
||||
/* Check that reserve is being closed if it is past its expiration date
|
||||
(and the closing fee would not exceed the remaining balance) */
|
||||
|
@ -104,13 +104,13 @@ function audit_only () {
|
||||
echo -n "."
|
||||
$VALGRIND taler-helper-auditor-deposits -L DEBUG -c $CONF -m $MASTER_PUB > test-audit-deposits-inc.json 2> test-audit-deposits-inc.log || exit_fail "incremental deposits audit failed"
|
||||
echo -n "."
|
||||
$VALGRIND taler-helper-auditor-reserves -L DEBUG -c $CONF -m $MASTER_PUB > test-audit-reserves.json 2> test-audit-reserves.log || exit_fail "reserves audit failed"
|
||||
$VALGRIND taler-helper-auditor-reserves -i -L DEBUG -c $CONF -m $MASTER_PUB > test-audit-reserves.json 2> test-audit-reserves.log || exit_fail "reserves audit failed"
|
||||
echo -n "."
|
||||
$VALGRIND taler-helper-auditor-reserves -L DEBUG -c $CONF -m $MASTER_PUB > test-audit-reserves-inc.json 2> test-audit-reserves-inc.log || exit_fail "incremental reserves audit failed"
|
||||
$VALGRIND taler-helper-auditor-reserves -i -L DEBUG -c $CONF -m $MASTER_PUB > test-audit-reserves-inc.json 2> test-audit-reserves-inc.log || exit_fail "incremental reserves audit failed"
|
||||
echo -n "."
|
||||
$VALGRIND taler-helper-auditor-wire -L DEBUG -c $CONF -m $MASTER_PUB > test-audit-wire.json 2> test-wire-audit.log || exit_fail "wire audit failed"
|
||||
$VALGRIND taler-helper-auditor-wire -i -L DEBUG -c $CONF -m $MASTER_PUB > test-audit-wire.json 2> test-wire-audit.log || exit_fail "wire audit failed"
|
||||
echo -n "."
|
||||
$VALGRIND taler-helper-auditor-wire -L DEBUG -c $CONF -m $MASTER_PUB > test-audit-wire-inc.json 2> test-wire-audit-inc.log || exit_fail "wire audit failed"
|
||||
$VALGRIND taler-helper-auditor-wire -i -L DEBUG -c $CONF -m $MASTER_PUB > test-audit-wire-inc.json 2> test-wire-audit-inc.log || exit_fail "wire audit failed"
|
||||
echo -n "."
|
||||
|
||||
echo " DONE"
|
||||
|
Loading…
Reference in New Issue
Block a user