gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [taler-merchant] branch master updated: Produce random orde


From: gnunet
Subject: [GNUnet-SVN] [taler-merchant] branch master updated: Produce random order_id.
Date: Wed, 22 Mar 2017 15:42:37 +0100

This is an automated email from the git hooks/post-receive script.

marcello pushed a commit to branch master
in repository merchant.

The following commit(s) were added to refs/heads/master by this push:
     new 5f35f8c  Produce random order_id.
5f35f8c is described below

commit 5f35f8cac34bbdfe31b950a0c706ed2737828006
Author: Marcello Stanisci <address@hidden>
AuthorDate: Wed Mar 22 15:42:21 2017 +0100

    Produce random order_id.
---
 src/samples/generate_payments.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/samples/generate_payments.c b/src/samples/generate_payments.c
index 515953f..4bf3a78 100644
--- a/src/samples/generate_payments.c
+++ b/src/samples/generate_payments.c
@@ -770,11 +770,6 @@ interpreter_run (void *cls)
 
       j++;
 
-      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                  "j=%d, times=%d\n",
-                  j,
-                  times);
-
       if (j < times)
       {
         is->ip = 0;
@@ -1329,6 +1324,7 @@ make_order (char *currency,
   struct TALER_Amount tmp_amount;
   json_t *tmp_total;
   json_t *tmp_maxfee;
+  unsigned long long id;
 
   GNUNET_asprintf (&tmp_str,
                    "%s:%s",
@@ -1346,9 +1342,12 @@ make_order (char *currency,
   TALER_string_to_amount (tmp_str, &tmp_amount);
   tmp_maxfee = TALER_JSON_from_amount (&tmp_amount);
 
+  GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK,
+                              &id,
+                              sizeof (id));
   GNUNET_asprintf (&ret, "{\
                   \"max_fee\":%s,\
-                  \"order_id\":\"1\",\
+                  \"order_id\":\"%s\",\
                   \"timestamp\":\"\\/Date(42)\\/\",\
                   \"refund_deadline\":\"\\/Date(0)\\/\",\
                   \"pay_deadline\":\"\\/Date(9999999999)\\/\",\
@@ -1357,6 +1356,7 @@ make_order (char *currency,
                   \"products\":\
                      [ {\"description\":\"ice cream\"} ] }",
                   json_dumps (tmp_maxfee, JSON_COMPACT),
+                  TALER_b2s (&id, sizeof (id)),
                   json_dumps (tmp_total, JSON_COMPACT));
 
   GNUNET_free (tmp_str);

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]