summaryrefslogtreecommitdiff
path: root/src/auditor/taler-helper-auditor-wire.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-10-30 21:26:40 +0200
committerChristian Grothoff <christian@grothoff.org>2021-10-30 21:26:40 +0200
commit2faf102a05865b68e90ef48f292678dd1da6356e (patch)
tree5196e22766c0d5f0692d30121bda0b0e25527aa2 /src/auditor/taler-helper-auditor-wire.c
parentbc57abc3daa56178378b5184b9ec987c860c5f62 (diff)
downloadexchange-2faf102a05865b68e90ef48f292678dd1da6356e.tar.gz
exchange-2faf102a05865b68e90ef48f292678dd1da6356e.tar.bz2
exchange-2faf102a05865b68e90ef48f292678dd1da6356e.zip
-more dB work
Diffstat (limited to 'src/auditor/taler-helper-auditor-wire.c')
-rw-r--r--src/auditor/taler-helper-auditor-wire.c109
1 files changed, 51 insertions, 58 deletions
diff --git a/src/auditor/taler-helper-auditor-wire.c b/src/auditor/taler-helper-auditor-wire.c
index 80a4568ff..3d8b0d1fd 100644
--- a/src/auditor/taler-helper-auditor-wire.c
+++ b/src/auditor/taler-helper-auditor-wire.c
@@ -942,16 +942,16 @@ check_time_difference (const char *table,
* @param rowid unique serial ID for the refresh session in our DB
* @param date timestamp of the transfer (roughly)
* @param wtid wire transfer subject
- * @param wire wire transfer details of the receiver
+ * @param payto_uri wire transfer details of the receiver
* @param amount amount that was wired
* @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop
*/
-static int
+static enum GNUNET_GenericReturnValue
wire_out_cb (void *cls,
uint64_t rowid,
struct GNUNET_TIME_Absolute date,
const struct TALER_WireTransferIdentifierRawP *wtid,
- const json_t *wire,
+ const char *payto_uri,
const struct TALER_Amount *amount)
{
struct WireAccount *wa = cls;
@@ -997,62 +997,55 @@ wire_out_cb (void *cls,
return GNUNET_SYSERR;
return GNUNET_OK;
}
+ if (0 != strcasecmp (payto_uri,
+ roi->details.credit_account_uri))
{
- char *payto_uri;
-
- payto_uri = TALER_JSON_wire_to_payto (wire);
- if (0 != strcasecmp (payto_uri,
- roi->details.credit_account_uri))
- {
- /* Destination bank account is wrong in actual wire transfer, so
- we should count the wire transfer as entirely spurious, and
- additionally consider the justified wire transfer as missing. */
- TALER_ARL_report (report_wire_out_inconsistencies,
- GNUNET_JSON_PACK (
- GNUNET_JSON_pack_uint64 ("row",
- rowid),
- TALER_JSON_pack_amount ("amount_wired",
- &roi->details.amount),
- TALER_JSON_pack_amount ("amount_justified",
- &zero),
- GNUNET_JSON_pack_data_auto ("wtid", wtid),
- TALER_JSON_pack_time_abs_human ("timestamp",
- date),
- GNUNET_JSON_pack_string ("diagnostic",
- "receiver account mismatch"),
- GNUNET_JSON_pack_string ("target",
- payto_uri),
- GNUNET_JSON_pack_string ("account_section",
- wa->ai->section_name)));
- TALER_ARL_amount_add (&total_bad_amount_out_plus,
- &total_bad_amount_out_plus,
- &roi->details.amount);
- TALER_ARL_report (report_wire_out_inconsistencies,
- GNUNET_JSON_PACK (
- GNUNET_JSON_pack_uint64 ("row",
- rowid),
- TALER_JSON_pack_amount ("amount_wired",
- &zero),
- TALER_JSON_pack_amount ("amount_justified",
- amount),
- GNUNET_JSON_pack_data_auto ("wtid",
- wtid),
- TALER_JSON_pack_time_abs_human ("timestamp",
- date),
- GNUNET_JSON_pack_string ("diagnostic",
- "receiver account mismatch"),
- GNUNET_JSON_pack_string ("target",
- roi->details.
- credit_account_uri),
- GNUNET_JSON_pack_string ("account_section",
- wa->ai->section_name)));
- TALER_ARL_amount_add (&total_bad_amount_out_minus,
- &total_bad_amount_out_minus,
- amount);
- GNUNET_free (payto_uri);
- goto cleanup;
- }
- GNUNET_free (payto_uri);
+ /* Destination bank account is wrong in actual wire transfer, so
+ we should count the wire transfer as entirely spurious, and
+ additionally consider the justified wire transfer as missing. */
+ TALER_ARL_report (report_wire_out_inconsistencies,
+ GNUNET_JSON_PACK (
+ GNUNET_JSON_pack_uint64 ("row",
+ rowid),
+ TALER_JSON_pack_amount ("amount_wired",
+ &roi->details.amount),
+ TALER_JSON_pack_amount ("amount_justified",
+ &zero),
+ GNUNET_JSON_pack_data_auto ("wtid", wtid),
+ TALER_JSON_pack_time_abs_human ("timestamp",
+ date),
+ GNUNET_JSON_pack_string ("diagnostic",
+ "receiver account mismatch"),
+ GNUNET_JSON_pack_string ("target",
+ payto_uri),
+ GNUNET_JSON_pack_string ("account_section",
+ wa->ai->section_name)));
+ TALER_ARL_amount_add (&total_bad_amount_out_plus,
+ &total_bad_amount_out_plus,
+ &roi->details.amount);
+ TALER_ARL_report (report_wire_out_inconsistencies,
+ GNUNET_JSON_PACK (
+ GNUNET_JSON_pack_uint64 ("row",
+ rowid),
+ TALER_JSON_pack_amount ("amount_wired",
+ &zero),
+ TALER_JSON_pack_amount ("amount_justified",
+ amount),
+ GNUNET_JSON_pack_data_auto ("wtid",
+ wtid),
+ TALER_JSON_pack_time_abs_human ("timestamp",
+ date),
+ GNUNET_JSON_pack_string ("diagnostic",
+ "receiver account mismatch"),
+ GNUNET_JSON_pack_string ("target",
+ roi->details.
+ credit_account_uri),
+ GNUNET_JSON_pack_string ("account_section",
+ wa->ai->section_name)));
+ TALER_ARL_amount_add (&total_bad_amount_out_minus,
+ &total_bad_amount_out_minus,
+ amount);
+ goto cleanup;
}
if (0 != TALER_amount_cmp (&roi->details.amount,
amount))