diff options
author | Christian Grothoff <christian@grothoff.org> | 2021-01-07 21:14:26 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2021-01-07 21:14:26 +0100 |
commit | 9d5a3ef6597a6a4d44a1737b9234011bc94328db (patch) | |
tree | 2c3006761bb19217af3b40e8cf2b66fb7f1b5f82 /src | |
parent | 9473ef4d86d8029237c018c72bf6311a3fe54987 (diff) | |
download | exchange-9d5a3ef6597a6a4d44a1737b9234011bc94328db.tar.xz |
only check tiny/done in internal mode
Diffstat (limited to 'src')
-rw-r--r-- | src/auditor/taler-helper-auditor-wire.c | 53 |
1 files changed, 39 insertions, 14 deletions
diff --git a/src/auditor/taler-helper-auditor-wire.c b/src/auditor/taler-helper-auditor-wire.c index fc91048a0..5e870813d 100644 --- a/src/auditor/taler-helper-auditor-wire.c +++ b/src/auditor/taler-helper-auditor-wire.c @@ -825,7 +825,9 @@ commit (enum GNUNET_DB_QueryStatus qs) * @param wire where should the funds be wired * @param deadline what was the requested wire transfer deadline * @param tiny did the exchange defer this transfer because it is too small? + * NOTE: only valid in internal audit mode! * @param done did the exchange claim that it made a transfer? + * NOTE: only valid in internal audit mode! */ static void wire_missing_cb (void *cls, @@ -837,25 +839,48 @@ wire_missing_cb (void *cls, /* bool? */ int tiny, /* bool? */ int done) { + json_t *rep; + (void) cls; TALER_ARL_amount_add (&total_amount_lag, &total_amount_lag, amount); - if ( (GNUNET_YES == tiny) && - (0 > TALER_amount_cmp (amount, - &tiny_amount)) ) - return; /* acceptable, amount was tiny */ + if (internal_checks) + { + /* In internal mode, we insist that the entry was + actually marked as tiny. */ + if ( (GNUNET_YES == tiny) && + (0 > TALER_amount_cmp (amount, + &tiny_amount)) ) + return; /* acceptable, amount was tiny */ + } + else + { + /* External auditors do not replicate tiny, so they + only check that the amount is tiny */ + if (0 > TALER_amount_cmp (amount, + &tiny_amount)) + return; /* acceptable, amount was tiny */ + } + rep = json_pack ("{s:I, s:o, s:o, s:o, s:O}", + "row", (json_int_t) rowid, + "amount", TALER_JSON_from_amount (amount), + "deadline", TALER_ARL_json_from_time_abs ( + deadline), + "coin_pub", GNUNET_JSON_from_data_auto ( + coin_pub), + "account", wire); + GNUNET_break (NULL != rep); + if (internal_checks) + { + /* the 'done' bit is only useful in 'internal' mode */ + GNUNET_break (0 == + json_object_set (rep, + "claimed_done", + json_string ((done) ? "yes" : "no"))); + } TALER_ARL_report (report_lags, - json_pack ("{s:I, s:o, s:o, s:s, s:o, s:O}", - "row", (json_int_t) rowid, - "amount", TALER_JSON_from_amount (amount), - "deadline", TALER_ARL_json_from_time_abs ( - deadline), - "claimed_done", (done) ? "yes" : "no", - "coin_pub", GNUNET_JSON_from_data_auto ( - coin_pub), - "account", wire)); - + rep); } |