diff options
author | Christian Grothoff <christian@grothoff.org> | 2019-10-26 20:55:43 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2019-10-26 20:55:43 +0200 |
commit | d78f07e8af8cf1fc83a0085269ddcda11f302bc5 (patch) | |
tree | ecaa3ed3c2c6e94eccc65feeb1dcc582be0fd912 | |
parent | 27bf43c4075ca03c500a6d3643fe575d910a202c (diff) | |
download | merchant-d78f07e8af8cf1fc83a0085269ddcda11f302bc5.tar.gz merchant-d78f07e8af8cf1fc83a0085269ddcda11f302bc5.tar.bz2 merchant-d78f07e8af8cf1fc83a0085269ddcda11f302bc5.zip |
add FORCE_AUDIT option
-rw-r--r-- | src/backend/taler-merchant-httpd.c | 11 | ||||
-rw-r--r-- | src/backend/taler-merchant-httpd.h | 5 | ||||
-rw-r--r-- | src/backend/taler-merchant-httpd_pay.c | 6 |
3 files changed, 19 insertions, 3 deletions
diff --git a/src/backend/taler-merchant-httpd.c b/src/backend/taler-merchant-httpd.c index bc784cde..91840559 100644 --- 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 index c7046d87..0deaf170 100644 --- 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 index 569b71d4..7b2e3fb9 100644 --- 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, |