diff options
author | Christian Grothoff <christian@grothoff.org> | 2023-11-22 22:23:45 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2023-11-22 22:23:45 +0100 |
commit | b87ad62692d9e0235554fecc52862cfca128dfe8 (patch) | |
tree | 7202c7381b27bb9b9eaf1a612221bf7154921a97 /src | |
parent | 39ade3c761bf2d4fb3c2c3e63523efbad1aafc08 (diff) |
-fix minor threading issue
Diffstat (limited to 'src')
-rw-r--r-- | src/bank-lib/fakebank_tbr_get_history.c | 4 | ||||
-rw-r--r-- | src/bank-lib/fakebank_twg_history.c | 8 |
2 files changed, 9 insertions, 3 deletions
diff --git a/src/bank-lib/fakebank_tbr_get_history.c b/src/bank-lib/fakebank_tbr_get_history.c index 4653c505b..7e7f9dda2 100644 --- a/src/bank-lib/fakebank_tbr_get_history.c +++ b/src/bank-lib/fakebank_tbr_get_history.c @@ -61,6 +61,7 @@ TALER_FAKEBANK_tbr_get_history_incoming ( const struct Transaction *pos; enum GNUNET_GenericReturnValue ret; bool in_shutdown; + const char *acc_payto_uri; if (NULL == cc) { @@ -269,6 +270,7 @@ TALER_FAKEBANK_tbr_get_history_incoming ( return MHD_YES; } in_shutdown = h->in_shutdown; + acc_payto_uri = hc->acc->payto_uri; GNUNET_assert (0 == pthread_mutex_unlock (&h->big_lock)); finish: @@ -291,7 +293,7 @@ finish: MHD_HTTP_OK, GNUNET_JSON_pack_string ( "credit_account", - hc->acc->payto_uri), + acc_payto_uri), GNUNET_JSON_pack_array_steal ( "incoming_transactions", h)); diff --git a/src/bank-lib/fakebank_twg_history.c b/src/bank-lib/fakebank_twg_history.c index 6bed3cdf0..c75b5c88b 100644 --- a/src/bank-lib/fakebank_twg_history.c +++ b/src/bank-lib/fakebank_twg_history.c @@ -307,6 +307,8 @@ TALER_FAKEBANK_twg_get_credit_history_ ( struct HistoryContext *hc; const struct Transaction *pos; enum GNUNET_GenericReturnValue ret; + bool in_shutdown; + const char *acc_payto_uri; if (NULL == cc) { @@ -493,12 +495,14 @@ TALER_FAKEBANK_twg_get_credit_history_ ( pthread_mutex_unlock (&h->big_lock)); return MHD_YES; } + in_shutdown = h->in_shutdown; + acc_payto_uri = hc->acc->payto_uri; GNUNET_assert (0 == pthread_mutex_unlock (&h->big_lock)); finish: if (0 == json_array_size (hc->history)) { - GNUNET_break (h->in_shutdown || + GNUNET_break (in_shutdown || (! GNUNET_TIME_absolute_is_future (hc->timeout))); return TALER_MHD_reply_static (connection, MHD_HTTP_NO_CONTENT, @@ -515,7 +519,7 @@ finish: MHD_HTTP_OK, GNUNET_JSON_pack_string ( "credit_account", - hc->acc->payto_uri), + acc_payto_uri), GNUNET_JSON_pack_array_steal ( "incoming_transactions", h)); |