[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-exchange] branch master updated: only check tiny/done in internal
From: |
gnunet |
Subject: |
[taler-exchange] branch master updated: only check tiny/done in internal mode |
Date: |
Thu, 07 Jan 2021 21:14:28 +0100 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository exchange.
The following commit(s) were added to refs/heads/master by this push:
new 9d5a3ef6 only check tiny/done in internal mode
9d5a3ef6 is described below
commit 9d5a3ef6597a6a4d44a1737b9234011bc94328db
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Thu Jan 7 21:14:26 2021 +0100
only check tiny/done in internal mode
---
src/auditor/taler-helper-auditor-wire.c | 53 ++++++++++++++++++++++++---------
1 file changed, 39 insertions(+), 14 deletions(-)
diff --git a/src/auditor/taler-helper-auditor-wire.c
b/src/auditor/taler-helper-auditor-wire.c
index fc91048a..5e870813 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);
}
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-exchange] branch master updated: only check tiny/done in internal mode,
gnunet <=