diff options
author | Christian Grothoff <christian@grothoff.org> | 2024-08-26 20:47:13 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2024-08-26 20:47:22 +0200 |
commit | 4662c5c9c593c17bd3956e6ddff4f95dd4367129 (patch) | |
tree | f3cee2350d5100ef90ade6b9cfbab86a77e2a0c6 /src/auditor | |
parent | 2b0814d69a1ac675f317ed913d05c882b3bcee6d (diff) |
fix #9130
Diffstat (limited to 'src/auditor')
-rw-r--r-- | src/auditor/taler-helper-auditor-coins.c | 74 |
1 files changed, 38 insertions, 36 deletions
diff --git a/src/auditor/taler-helper-auditor-coins.c b/src/auditor/taler-helper-auditor-coins.c index c920e0ca3..725e42828 100644 --- a/src/auditor/taler-helper-auditor-coins.c +++ b/src/auditor/taler-helper-auditor-coins.c @@ -70,6 +70,7 @@ static TALER_ARL_DEF_AB (total_escrowed); static TALER_ARL_DEF_AB (coin_irregular_loss); static TALER_ARL_DEF_AB (coin_melt_fee_revenue); static TALER_ARL_DEF_AB (coin_deposit_fee_revenue); +static TALER_ARL_DEF_AB (coin_deposit_fee_loss); static TALER_ARL_DEF_AB (coin_refund_fee_revenue); static TALER_ARL_DEF_AB (total_recoup_loss); @@ -1952,9 +1953,9 @@ refund_cb (void *cls, &issue->fees.refund); if (full_refund) { - TALER_ARL_amount_subtract (&TALER_ARL_USE_AB (coin_deposit_fee_revenue), - &TALER_ARL_USE_AB (coin_deposit_fee_revenue), - &issue->fees.deposit); + TALER_ARL_amount_add (&TALER_ARL_USE_AB (coin_deposit_fee_loss), + &TALER_ARL_USE_AB (coin_deposit_fee_loss), + &issue->fees.deposit); } return GNUNET_OK; } @@ -2047,9 +2048,9 @@ purse_refund_coin_cb ( TALER_amount2s (&ds->dcd.denom_balance)); } /* update total deposit fee balance */ - TALER_ARL_amount_subtract (&TALER_ARL_USE_AB (coin_deposit_fee_revenue), - &TALER_ARL_USE_AB (coin_deposit_fee_revenue), - &issue->fees.deposit); + TALER_ARL_amount_add (&TALER_ARL_USE_AB (coin_deposit_fee_loss), + &TALER_ARL_USE_AB (coin_deposit_fee_loss), + &issue->fees.deposit); return GNUNET_OK; } @@ -2748,6 +2749,7 @@ analyze_coins (void *cls) TALER_ARL_GET_AB (coin_irregular_loss), TALER_ARL_GET_AB (coin_melt_fee_revenue), TALER_ARL_GET_AB (coin_deposit_fee_revenue), + TALER_ARL_GET_AB (coin_deposit_fee_loss), TALER_ARL_GET_AB (coin_refund_fee_revenue), TALER_ARL_GET_AB (total_recoup_loss), TALER_ARL_GET_AB (coins_total_arithmetic_delta_plus), @@ -2776,12 +2778,12 @@ analyze_coins (void *cls) } if (0 > cc.qs) return cc.qs; - /* process refunds */ + /* process recoups */ if (0 > - (qs = TALER_ARL_edb->select_refunds_above_serial_id ( + (qs = TALER_ARL_edb->select_recoup_refresh_above_serial_id ( TALER_ARL_edb->cls, - TALER_ARL_USE_PP (coins_refund_serial_id), - &refund_cb, + TALER_ARL_USE_PP (coins_recoup_refresh_serial_id), + &recoup_refresh_cb, &cc))) { GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qs); @@ -2789,28 +2791,25 @@ analyze_coins (void *cls) } if (0 > cc.qs) return cc.qs; - /* process purse_refunds */ + /* process deposits */ if (0 > - (qs = TALER_ARL_edb->select_purse_decisions_above_serial_id ( + (qs = TALER_ARL_edb->select_coin_deposits_above_serial_id ( TALER_ARL_edb->cls, - TALER_ARL_USE_PP (coins_purse_refunds_serial_id), - true, /* only go for refunds! */ - &purse_refund_cb, + TALER_ARL_USE_PP (coins_deposit_serial_id), + &deposit_cb, &cc))) { - GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qs); return qs; } if (0 > cc.qs) return cc.qs; - - /* process recoups */ + /* process purse_deposits */ if (0 > - (qs = TALER_ARL_edb->select_recoup_refresh_above_serial_id ( + (qs = TALER_ARL_edb->select_purse_deposits_above_serial_id ( TALER_ARL_edb->cls, - TALER_ARL_USE_PP (coins_recoup_refresh_serial_id), - &recoup_refresh_cb, + TALER_ARL_USE_PP (coins_purse_deposits_serial_id), + &purse_deposit_cb, &cc))) { GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qs); @@ -2818,11 +2817,12 @@ analyze_coins (void *cls) } if (0 > cc.qs) return cc.qs; + /* process refunds */ if (0 > - (qs = TALER_ARL_edb->select_recoup_above_serial_id ( + (qs = TALER_ARL_edb->select_refunds_above_serial_id ( TALER_ARL_edb->cls, - TALER_ARL_USE_PP (coins_recoup_serial_id), - &recoup_cb, + TALER_ARL_USE_PP (coins_refund_serial_id), + &refund_cb, &cc))) { GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qs); @@ -2830,12 +2830,13 @@ analyze_coins (void *cls) } if (0 > cc.qs) return cc.qs; - /* process refreshes */ + /* process purse_refunds */ if (0 > - (qs = TALER_ARL_edb->select_refreshes_above_serial_id ( + (qs = TALER_ARL_edb->select_purse_decisions_above_serial_id ( TALER_ARL_edb->cls, - TALER_ARL_USE_PP (coins_melt_serial_id), - &refresh_session_cb, + TALER_ARL_USE_PP (coins_purse_refunds_serial_id), + true, /* only go for refunds! */ + &purse_refund_cb, &cc))) { GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qs); @@ -2843,12 +2844,12 @@ analyze_coins (void *cls) } if (0 > cc.qs) return cc.qs; - /* process deposits */ + /* process refreshes */ if (0 > - (qs = TALER_ARL_edb->select_coin_deposits_above_serial_id ( + (qs = TALER_ARL_edb->select_refreshes_above_serial_id ( TALER_ARL_edb->cls, - TALER_ARL_USE_PP (coins_deposit_serial_id), - &deposit_cb, + TALER_ARL_USE_PP (coins_melt_serial_id), + &refresh_session_cb, &cc))) { GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qs); @@ -2856,12 +2857,11 @@ analyze_coins (void *cls) } if (0 > cc.qs) return cc.qs; - /* process purse_deposits */ if (0 > - (qs = TALER_ARL_edb->select_purse_deposits_above_serial_id ( + (qs = TALER_ARL_edb->select_recoup_above_serial_id ( TALER_ARL_edb->cls, - TALER_ARL_USE_PP (coins_purse_deposits_serial_id), - &purse_deposit_cb, + TALER_ARL_USE_PP (coins_recoup_serial_id), + &recoup_cb, &cc))) { GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qs); @@ -2891,6 +2891,7 @@ analyze_coins (void *cls) TALER_ARL_SET_AB (coin_irregular_loss), TALER_ARL_SET_AB (coin_melt_fee_revenue), TALER_ARL_SET_AB (coin_deposit_fee_revenue), + TALER_ARL_SET_AB (coin_deposit_fee_loss), TALER_ARL_SET_AB (coin_refund_fee_revenue), TALER_ARL_SET_AB (total_recoup_loss), TALER_ARL_SET_AB (coins_total_arithmetic_delta_plus), @@ -2916,6 +2917,7 @@ analyze_coins (void *cls) TALER_ARL_SET_AB (coin_irregular_loss), TALER_ARL_SET_AB (coin_melt_fee_revenue), TALER_ARL_SET_AB (coin_deposit_fee_revenue), + TALER_ARL_SET_AB (coin_deposit_fee_loss), TALER_ARL_SET_AB (coin_refund_fee_revenue), TALER_ARL_SET_AB (total_recoup_loss), TALER_ARL_SET_AB (coins_total_arithmetic_delta_plus), |