rename a_balance (#6170)

This commit is contained in:
Christian Grothoff 2020-04-08 18:23:21 +02:00
parent 50bc862a68
commit 1554cc310d
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC

View File

@ -263,7 +263,7 @@ struct ReserveSummary
* Previous balance of the reserve as remembered by the auditor. * Previous balance of the reserve as remembered by the auditor.
* (updated based on @e total_in and @e total_out at the end). * (updated based on @e total_in and @e total_out at the end).
*/ */
struct TALER_Amount a_balance; struct TALER_Amount balance_at_previous_audit;
/** /**
* Previous withdraw fee balance of the reserve, as remembered by the auditor. * Previous withdraw fee balance of the reserve, as remembered by the auditor.
@ -312,7 +312,7 @@ load_auditor_reserve_summary (struct ReserveSummary *rs)
&rs->reserve_pub, &rs->reserve_pub,
&TALER_ARL_master_pub, &TALER_ARL_master_pub,
&rowid, &rowid,
&rs->a_balance, &rs->balance_at_previous_audit,
&rs->a_withdraw_fee_balance, &rs->a_withdraw_fee_balance,
&rs->a_expiration_date, &rs->a_expiration_date,
&rs->sender_account); &rs->sender_account);
@ -326,23 +326,23 @@ load_auditor_reserve_summary (struct ReserveSummary *rs)
rs->had_ri = GNUNET_NO; rs->had_ri = GNUNET_NO;
GNUNET_assert (GNUNET_OK == GNUNET_assert (GNUNET_OK ==
TALER_amount_get_zero (rs->total_in.currency, TALER_amount_get_zero (rs->total_in.currency,
&rs->a_balance)); &rs->balance_at_previous_audit));
GNUNET_assert (GNUNET_OK == GNUNET_assert (GNUNET_OK ==
TALER_amount_get_zero (rs->total_in.currency, TALER_amount_get_zero (rs->total_in.currency,
&rs->a_withdraw_fee_balance)); &rs->a_withdraw_fee_balance));
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Creating fresh reserve `%s' with starting balance %s\n", "Creating fresh reserve `%s' with starting balance %s\n",
TALER_B2S (&rs->reserve_pub), TALER_B2S (&rs->reserve_pub),
TALER_amount2s (&rs->a_balance)); TALER_amount2s (&rs->balance_at_previous_audit));
return GNUNET_DB_STATUS_SUCCESS_NO_RESULTS; return GNUNET_DB_STATUS_SUCCESS_NO_RESULTS;
} }
rs->had_ri = GNUNET_YES; rs->had_ri = GNUNET_YES;
if ( (GNUNET_YES != if ( (GNUNET_YES !=
TALER_amount_cmp_currency (&rs->a_balance, TALER_amount_cmp_currency (&rs->balance_at_previous_audit,
&rs->a_withdraw_fee_balance)) || &rs->a_withdraw_fee_balance)) ||
(GNUNET_YES != (GNUNET_YES !=
TALER_amount_cmp_currency (&rs->total_in, TALER_amount_cmp_currency (&rs->total_in,
&rs->a_balance)) ) &rs->balance_at_previous_audit)) )
{ {
GNUNET_break (0); GNUNET_break (0);
return GNUNET_DB_STATUS_HARD_ERROR; return GNUNET_DB_STATUS_HARD_ERROR;
@ -350,7 +350,7 @@ load_auditor_reserve_summary (struct ReserveSummary *rs)
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Auditor remembers reserve `%s' has balance %s\n", "Auditor remembers reserve `%s' has balance %s\n",
TALER_B2S (&rs->reserve_pub), TALER_B2S (&rs->reserve_pub),
TALER_amount2s (&rs->a_balance)); TALER_amount2s (&rs->balance_at_previous_audit));
return GNUNET_DB_STATUS_SUCCESS_ONE_RESULT; return GNUNET_DB_STATUS_SUCCESS_ONE_RESULT;
} }
@ -1028,7 +1028,7 @@ verify_reserve_balance (void *cls,
GNUNET_assert (GNUNET_OK == GNUNET_assert (GNUNET_OK ==
TALER_amount_add (&balance, TALER_amount_add (&balance,
&rs->total_in, &rs->total_in,
&rs->a_balance)); &rs->balance_at_previous_audit));
if (GNUNET_SYSERR == if (GNUNET_SYSERR ==
TALER_amount_subtract (&nbalance, TALER_amount_subtract (&nbalance,
&balance, &balance,