From 948e2372b857089aeac08b425e5852a71e1191c1 Mon Sep 17 00:00:00 2001 From: Yuki Kondo Date: Thu, 24 Aug 2017 20:17:18 +0000 Subject: [PATCH] [FAB-5913]balance-transfer:Fix query response message MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit "queryChaincode" doesn’t output responses from all peers in log message. It exits the loop processing after outputting the first response. We should print all responses from all peers. Also, we should return a response (e.g. the response_payloads[0]) after the loop. This patch fixes the problems above. Change-Id: I92a0c5a663d6da0854d89bf76c5ba36da86754ef Signed-off-by: Yuki Kondo --- balance-transfer/app/query.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/balance-transfer/app/query.js b/balance-transfer/app/query.js index 22ed5162d0..8607dde879 100644 --- a/balance-transfer/app/query.js +++ b/balance-transfer/app/query.js @@ -44,9 +44,9 @@ var queryChaincode = async function(peer, channelName, chaincodeName, args, fcn, for (let i = 0; i < response_payloads.length; i++) { logger.info(args[0]+' now has ' + response_payloads[i].toString('utf8') + ' after the move'); - return args[0]+' now has ' + response_payloads[i].toString('utf8') + - ' after the move'; } + return args[0]+' now has ' + response_payloads[0].toString('utf8') + + ' after the move'; } else { logger.error('response_payloads is null'); return 'response_payloads is null';