summaryrefslogtreecommitdiff
path: root/src/backend/taler-merchant-httpd_private-get-orders-ID.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-10-12 22:19:56 +0200
committerChristian Grothoff <christian@grothoff.org>2020-10-12 22:19:56 +0200
commitcf733c2b743b1e2d3c1e7a7d296aff71d70cf4e2 (patch)
tree444338d76a5a4a07eafef11ff012829a697d6a4c /src/backend/taler-merchant-httpd_private-get-orders-ID.c
parent794d43a336567dbafac442ca90071994b7fd9ada (diff)
downloadmerchant-cf733c2b743b1e2d3c1e7a7d296aff71d70cf4e2.tar.gz
merchant-cf733c2b743b1e2d3c1e7a7d296aff71d70cf4e2.tar.bz2
merchant-cf733c2b743b1e2d3c1e7a7d296aff71d70cf4e2.zip
clarify comment
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;