exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

commit b5894dd3c2624508ff3315d1c894dd2a8595f05e
parent 10138e400b662cd0d6f72eea77441edbc6b34af1
Author: Christian Grothoff <christian@grothoff.org>
Date:   Mon, 28 Apr 2025 01:59:39 +0200

fix #9803 (support KYC auth in wire auditor)

Diffstat:
Msrc/auditor/taler-helper-auditor-wire-credit.c | 23+++++++++++++++++++++--
1 file changed, 21 insertions(+), 2 deletions(-)

diff --git a/src/auditor/taler-helper-auditor-wire-credit.c b/src/auditor/taler-helper-auditor-wire-credit.c @@ -169,6 +169,11 @@ static TALER_ARL_DEF_AB (total_misattribution_in); static TALER_ARL_DEF_AB (total_wire_in); /** + * Total amount credited to exchange accounts via KYCAUTH + */ +static TALER_ARL_DEF_AB (total_kycauth_in); + +/** * Total wire credit fees charged to the exchange account. */ static TALER_ARL_DEF_AB (total_wire_credit_fees); @@ -375,6 +380,7 @@ commit (enum GNUNET_DB_QueryStatus qs) qs = TALER_ARL_adb->update_balance ( TALER_ARL_adb->cls, TALER_ARL_SET_AB (total_wire_in), + TALER_ARL_SET_AB (total_kycauth_in), TALER_ARL_SET_AB (total_wire_credit_fees), TALER_ARL_SET_AB (total_bad_amount_in_plus), TALER_ARL_SET_AB (total_bad_amount_in_minus), @@ -385,6 +391,7 @@ commit (enum GNUNET_DB_QueryStatus qs) qs = TALER_ARL_adb->insert_balance ( TALER_ARL_adb->cls, TALER_ARL_SET_AB (total_wire_in), + TALER_ARL_SET_AB (total_kycauth_in), TALER_ARL_SET_AB (total_wire_credit_fees), TALER_ARL_SET_AB (total_bad_amount_in_plus), TALER_ARL_SET_AB (total_bad_amount_in_minus), @@ -744,8 +751,19 @@ analyze_credit ( struct ReserveInInfo *rii; struct GNUNET_HashCode key; - GNUNET_assert (TALER_BANK_CT_RESERVE == - credit_details->type); + switch (credit_details->type) + { + case TALER_BANK_CT_RESERVE: + break; + case TALER_BANK_CT_KYCAUTH: + TALER_ARL_amount_add (&TALER_ARL_USE_AB (total_kycauth_in), + &TALER_ARL_USE_AB (total_kycauth_in), + &credit_details->amount); + return true; + case TALER_BANK_CT_WAD: + GNUNET_break (0); /* FIXME: Wad not yet supported */ + return false; + } GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Analyzing bank CREDIT #%llu at %s of %s with Reserve-pub %s\n", (unsigned long long) credit_details->serial_id, @@ -1140,6 +1158,7 @@ begin_transaction (void) qs = TALER_ARL_adb->get_balance ( TALER_ARL_adb->cls, TALER_ARL_GET_AB (total_wire_in), + TALER_ARL_GET_AB (total_kycauth_in), TALER_ARL_GET_AB (total_wire_credit_fees), TALER_ARL_GET_AB (total_bad_amount_in_plus), TALER_ARL_GET_AB (total_bad_amount_in_minus),