summaryrefslogtreecommitdiff
path: root/src/backend/taler-merchant-httpd_private-get-orders-ID.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/taler-merchant-httpd_private-get-orders-ID.c')
-rw-r--r--src/backend/taler-merchant-httpd_private-get-orders-ID.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/backend/taler-merchant-httpd_private-get-orders-ID.c b/src/backend/taler-merchant-httpd_private-get-orders-ID.c
index 1d4bde27..dbac2295 100644
--- a/src/backend/taler-merchant-httpd_private-get-orders-ID.c
+++ b/src/backend/taler-merchant-httpd_private-get-orders-ID.c
@@ -820,8 +820,13 @@ TMH_private_get_orders_ID (const struct TMH_RequestHandler *rh,
gorc->sc.long_poll_timeout));
if (NULL != gorc->contract_terms)
{
- /* Clear old contract terms, might be from an earlier unclaimed contract
- and thus could have changed during claiming. */
+ /* Free memory filled with old contract terms before fetching the latest
+ ones from the DB. Note that we cannot simply skip the database
+ interaction as the contract terms loaded previously might be from an
+ earlier *unclaimed* order state (which we loaded in a previous
+ invocation of this function and we are back here due to long polling)
+ and thus the contract terms could have changed during claiming. Thus,
+ we need to fetch the latest contract terms from the DB again. *///
json_decref (gorc->contract_terms);
gorc->contract_terms = NULL;
gorc->fulfillment_url = NULL;