From 80f6c4240ee26884ac2dfdc02ff6b8aac0951777 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Tue, 19 Jan 2016 14:39:00 +0100 Subject: -fix (C) notices --- src/mint-lib/mint_api_refresh_link.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mint-lib/mint_api_refresh_link.c') diff --git a/src/mint-lib/mint_api_refresh_link.c b/src/mint-lib/mint_api_refresh_link.c index d4060bd1..17c96039 100644 --- a/src/mint-lib/mint_api_refresh_link.c +++ b/src/mint-lib/mint_api_refresh_link.c @@ -1,6 +1,6 @@ /* This file is part of TALER - Copyright (C) 2015 Christian Grothoff (and other contributing authors) + Copyright (C) 2015 GNUnet e.V. TALER is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software -- cgit v1.2.3 From a64b6053770339f3ae2de4f779bad42c7109cb0d Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 20 Jan 2016 16:21:32 +0100 Subject: indent, etc. --- src/mint-lib/mint_api_refresh_link.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/mint-lib/mint_api_refresh_link.c') diff --git a/src/mint-lib/mint_api_refresh_link.c b/src/mint-lib/mint_api_refresh_link.c index d4060bd1..c8793259 100644 --- a/src/mint-lib/mint_api_refresh_link.c +++ b/src/mint-lib/mint_api_refresh_link.c @@ -194,7 +194,7 @@ parse_refresh_link_ok (struct TALER_MINT_RefreshLinkHandle *rlh, }; if (GNUNET_OK != - MAJ_parse_json (json_array_get (json, + MAJ_parse_json (json_array_get (json, session), spec)) { @@ -218,7 +218,7 @@ parse_refresh_link_ok (struct TALER_MINT_RefreshLinkHandle *rlh, struct TALER_CoinSpendPrivateKeyP coin_privs[num_coins]; struct TALER_DenominationSignature sigs[num_coins]; struct TALER_DenominationPublicKey pubs[num_coins]; - + off_coin = 0; for (session=0;sessionlink_cb (rlh->link_cb_cls, -- cgit v1.2.3 From 014b901b2cf7a307ab5a16750be72a8f27ef8e89 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 21 Jan 2016 16:12:05 +0100 Subject: fix clean up logic of mint_api_refresh_link --- src/mint-lib/mint_api_refresh_link.c | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) (limited to 'src/mint-lib/mint_api_refresh_link.c') diff --git a/src/mint-lib/mint_api_refresh_link.c b/src/mint-lib/mint_api_refresh_link.c index 9ae55b2a..dcd2326c 100644 --- a/src/mint-lib/mint_api_refresh_link.c +++ b/src/mint-lib/mint_api_refresh_link.c @@ -1,6 +1,6 @@ /* This file is part of TALER - Copyright (C) 2015 GNUnet e.V. + Copyright (C) 2015, 2016 GNUnet e.V. TALER is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -185,6 +185,17 @@ parse_refresh_link_ok (struct TALER_MINT_RefreshLinkHandle *rlh, return GNUNET_SYSERR; } num_coins = 0; + /* Theoretically, a coin may have been melted repeatedly + into different sessions; so the response is an array + which contains information by melting session. That + array contains another array. However, our API returns + a single 1d array, so we flatten the 2d array that is + returned into a single array. Note that usually a coin + is melted at most once, and so we'll only run this + loop once for 'session=0' in most cases. + + num_coins tracks the size of the 1d array we return, + whilst 'i' and 'session' track the 2d array. */ for (session=0;session