commit d78f07e8af8cf1fc83a0085269ddcda11f302bc5
parent 27bf43c4075ca03c500a6d3643fe575d910a202c
Author: Christian Grothoff <christian@grothoff.org>
Date: Sat, 26 Oct 2019 20:55:43 +0200
add FORCE_AUDIT option
Diffstat:
3 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/src/backend/taler-merchant-httpd.c b/src/backend/taler-merchant-httpd.c
@@ -120,6 +120,11 @@ int TMH_merchant_connection_close;
char *TMH_currency;
/**
+ * Inform the auditor for all deposit confirmations (global option)
+ */
+int TMH_force_audit;
+
+/**
* Task running the HTTP server.
*/
static struct GNUNET_SCHEDULER_Task *mhd_task;
@@ -1343,7 +1348,11 @@ run (void *cls,
GNUNET_SCHEDULER_shutdown ();
return;
}
-
+ if (GNUNET_YES ==
+ GNUNET_CONFIGURATION_get_value_yesno (config,
+ "merchant",
+ "FORCE_AUDIT"))
+ TMH_force_audit = GNUNET_YES;
if (GNUNET_SYSERR ==
TMH_EXCHANGES_init (config))
{
diff --git a/src/backend/taler-merchant-httpd.h b/src/backend/taler-merchant-httpd.h
@@ -296,6 +296,11 @@ extern unsigned long long default_wire_fee_amortization;
extern char *TMH_currency;
/**
+ * Inform the auditor for all deposit confirmations (global option)
+ */
+extern int TMH_force_audit;
+
+/**
* Hash of our wire format details as given in #j_wire.
*/
extern struct GNUNET_HashCode h_wire;
diff --git a/src/backend/taler-merchant-httpd_pay.c b/src/backend/taler-merchant-httpd_pay.c
@@ -1203,7 +1203,8 @@ process_pay_with_exchange (void *cls,
"coin_idx", i));
return;
}
-
+ if (TMH_force_audit)
+ TALER_EXCHANGE_deposit_force_dc (dc->dh);
pc->pending_at_ce++;
}
}
@@ -1409,7 +1410,8 @@ parse_pay (struct MHD_Connection *connection,
if (0 != GNUNET_memcmp (&merchant_pub,
&pc->mi->pubkey))
{
- TALER_LOG_INFO ("Unknown merchant public key included in payment (usually wrong instance chosen)\n");
+ TALER_LOG_INFO (
+ "Unknown merchant public key included in payment (usually wrong instance chosen)\n");
TMH_RESPONSE_reply_rc (connection,
MHD_HTTP_NOT_FOUND,
TALER_EC_PAY_WRONG_INSTANCE,