From 83fa6403834e570fb97cd3fcfc30f6130fac9e72 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 24 Aug 2022 20:12:21 +0200 Subject: -more logging about pay progression --- src/backend/taler-merchant-httpd_exchanges.c | 23 +++++++++++++++++----- .../taler-merchant-httpd_post-orders-ID-pay.c | 22 +++++++++++++++++++-- 2 files changed, 38 insertions(+), 7 deletions(-) (limited to 'src/backend') diff --git a/src/backend/taler-merchant-httpd_exchanges.c b/src/backend/taler-merchant-httpd_exchanges.c index be29cfcc..b74ae211 100644 --- a/src/backend/taler-merchant-httpd_exchanges.c +++ b/src/backend/taler-merchant-httpd_exchanges.c @@ -505,7 +505,7 @@ process_wire_accounts (struct Exchange *exchange, * @param wire_method the wire method we want the fees for * @return NULL if we do not have fees for this method yet */ -static struct FeesByWireMethod * +static const struct FeesByWireMethod * get_wire_fees (struct Exchange *exchange, struct GNUNET_TIME_Timestamp now, const char *wire_method) @@ -559,7 +559,7 @@ process_find_operations (struct Exchange *exchange) NULL != fo; fo = fn) { - struct FeesByWireMethod *fbw; + const struct FeesByWireMethod *fbw; fn = fo->next; if (NULL != fo->wire_method) @@ -571,6 +571,10 @@ process_find_operations (struct Exchange *exchange) if (NULL == fbw) { need_wire = true; + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Missing wire fees for exchange %s and method %s\n", + exchange->url, + fo->wire_method); /* Do not warn if this is before our first attempt */ if (! GNUNET_TIME_relative_is_zero (exchange->wire_retry_delay)) GNUNET_log (GNUNET_ERROR_TYPE_WARNING, @@ -656,6 +660,8 @@ handle_wire_data (void *cls, enum TALER_ErrorCode ecx; exchange->wire_request = NULL; + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Received /wire response\n"); if (MHD_HTTP_OK != hr->http_status) { struct TMH_EXCHANGES_FindOperation *fo; @@ -752,6 +758,8 @@ wire_task_cb (void *cls) if (! process_find_operations (exchange)) return; /* no more need */ GNUNET_assert (NULL == exchange->wire_request); + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Initiating /wire download\n"); exchange->wire_request = TALER_EXCHANGE_wire (exchange->conn, &handle_wire_data, exchange); @@ -1118,8 +1126,13 @@ TMH_EXCHANGES_find_exchange (const char *chosen_exchange, = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_relative_max ( exchange->retry_delay, FORCED_RELOAD_DELAY)); - TALER_EXCHANGE_check_keys_current (exchange->conn, - TALER_EXCHANGE_CKF_FORCE_DOWNLOAD); + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "/keys retry forced, waiting until %s\n", + GNUNET_TIME_absolute2s (exchange->first_retry)); + /* NOTE: return value tells us how long /keys should still + be valid. */ + (void) TALER_EXCHANGE_check_keys_current (exchange->conn, + TALER_EXCHANGE_CKF_FORCE_DOWNLOAD); return fo; } @@ -1156,7 +1169,7 @@ TMH_EXCHANGES_find_exchange (const char *chosen_exchange, (NULL == exchange->wire_task) && (NULL == exchange->wire_request) ) { - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Do not have required wire data. Will re-request /wire now\n"); exchange->wire_task = GNUNET_SCHEDULER_add_now (&wire_task_cb, exchange); diff --git a/src/backend/taler-merchant-httpd_post-orders-ID-pay.c b/src/backend/taler-merchant-httpd_post-orders-ID-pay.c index 8be93a01..1354d730 100644 --- a/src/backend/taler-merchant-httpd_post-orders-ID-pay.c +++ b/src/backend/taler-merchant-httpd_post-orders-ID-pay.c @@ -1073,6 +1073,9 @@ batch_deposit_cb ( struct PayContext *pc = eg->pc; eg->bdh = NULL; + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Batch deposit completed with status %u\n", + dr->hr.http_status); GNUNET_assert (GNUNET_YES == pc->suspended); pc->pending_at_eg--; switch (dr->hr.http_status) @@ -1171,6 +1174,11 @@ process_pay_with_exchange ( (void) payto_uri; eg->fo = NULL; + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Processing payment with exchange %s\n", + (NULL == exchange_handle) + ? "" + : TALER_EXCHANGE_get_base_url (exchange_handle)); GNUNET_assert (GNUNET_YES == pc->suspended); if (NULL == hr) { @@ -1229,6 +1237,8 @@ process_pay_with_exchange ( &dc->cdd.h_denom_pub); if (NULL == denom_details) { + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Denomination not found, re-fetching /keys\n"); if (! eg->tried_force_keys) { /* let's try *forcing* a re-download of /keys from the exchange. @@ -1270,6 +1280,8 @@ process_pay_with_exchange ( { if (! eg->tried_force_keys) { + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Denomination not audited by trusted auditor, re-fetching /keys\n"); /* let's try *forcing* a re-download of /keys from the exchange. Maybe the wallet has seen auditors that we missed. */ eg->tried_force_keys = true; @@ -1301,7 +1313,7 @@ process_pay_with_exchange ( if (is_age_restricted_denom && (0 < pc->minimum_age)) { - /* Minimum age given and restricted coind provided: We need to verify the + /* Minimum age given and restricted coin provided: We need to verify the * minimum age */ unsigned int code = 0; @@ -1372,6 +1384,9 @@ AGE_FAIL: { GNUNET_break (0); pc->pending_at_eg--; + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Group size zero, %u batch transactions remain pending\n", + pc->pending_at_eg); if (0 == pc->pending_at_eg) execute_pay_transaction (pc); return; @@ -1404,6 +1419,9 @@ AGE_FAIL: dc->wire_fee = *wire_fee; GNUNET_assert (NULL != pc->wm); } + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Initiating batch deposit with %u coins\n", + group_size); eg->bdh = TALER_EXCHANGE_batch_deposit (exchange_handle, &dcd, group_size, @@ -2679,7 +2697,7 @@ handle_pay_timeout (void *cls) pc->timeout_task = NULL; GNUNET_assert (GNUNET_YES == pc->suspended); - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Resuming pay with error after timeout\n"); resume_pay_with_error (pc, MHD_HTTP_GATEWAY_TIMEOUT, -- cgit v1.2.3