merchant

Merchant backend to process payments, run by merchants
Log | Files | Refs | Submodules | README | LICENSE

commit f77c265753f878386f374ea05b5f170c728b866f
parent b1ccf194316920ff1898cca8c1a34169470dc164
Author: Christian Grothoff <christian@grothoff.org>
Date:   Sat,  6 Jan 2024 21:51:54 +0100

-fix keys initialization

Diffstat:
Msrc/backend/taler-merchant-depositcheck.c | 12+++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/backend/taler-merchant-depositcheck.c b/src/backend/taler-merchant-depositcheck.c @@ -367,6 +367,8 @@ run_at (struct GNUNET_TIME_Absolute deadline) >, next_deadline)) return; + if (NULL == keys) + return; /* too early */ if (NULL != task) GNUNET_SCHEDULER_cancel (task); next_deadline = deadline; @@ -499,6 +501,7 @@ deposit_get_cb (void *cls, w); w_count--; GNUNET_free (w); + GNUNET_assert (NULL != keys); if ( (w_count < CONCURRENCY_LIMIT / 2) || (0 == w_count) ) task = GNUNET_SCHEDULER_add_now (&select_work, @@ -668,7 +671,7 @@ select_work (void *cls) * * @param cls closure, NULL * @param kr response from /keys - * @param[in] keys keys object passed to callback with + * @param[in] in_keys keys object passed to callback with * reference counter of 1. Must be freed by callee * using #TALER_EXCHANGE_keys_decref(). NULL on failure. */ @@ -676,10 +679,10 @@ static void keys_cb ( void *cls, const struct TALER_EXCHANGE_KeysResponse *kr, - struct TALER_EXCHANGE_Keys *keys) + struct TALER_EXCHANGE_Keys *in_keys) { gkh = NULL; - if (NULL == keys) + if (NULL == in_keys) { GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Failed to download %skeys\n", @@ -687,8 +690,7 @@ keys_cb ( GNUNET_SCHEDULER_shutdown (); return; } - keys = TALER_EXCHANGE_keys_incref (keys); - GNUNET_assert (NULL == task); + keys = TALER_EXCHANGE_keys_incref (in_keys); task = GNUNET_SCHEDULER_add_now (&select_work, NULL); }