From 1e77954eba42b1d100ba3032aa8e06990f512efe Mon Sep 17 00:00:00 2001 From: sairajzero Date: Tue, 8 Mar 2022 03:55:41 +0530 Subject: [PATCH] Minor fixes - update floBlockchainAPI - Fixed: senderID not working correctly in GET request when Array is passed --- src/database.js | 2 ++ src/floBlockchainAPI.js | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/database.js b/src/database.js index 8c55372..efcc11d 100644 --- a/src/database.js +++ b/src/database.js @@ -298,6 +298,8 @@ function Database(user, password, dbname, host = 'localhost') { if (request.type) conditionArr.push(`${H_struct.TYPE} = '${request.type}'`); if (request.senderID) { + if (typeof request.senderID === "string" && request.senderID.includes(',')) + request.senderID = request.senderID.split(','); if (Array.isArray(request.senderID)) conditionArr.push(`${H_struct.SENDER_ID} IN ('${request.senderID.join("', '")}')`); else diff --git a/src/floBlockchainAPI.js b/src/floBlockchainAPI.js index 5db40df..d76470f 100644 --- a/src/floBlockchainAPI.js +++ b/src/floBlockchainAPI.js @@ -1,6 +1,6 @@ 'use strict'; /* FLO Blockchain Operator to send/receive data from blockchain using API calls*/ -//version 2.2.1 +//version 2.2.1a (function(GLOBAL) { const floBlockchainAPI = GLOBAL.floBlockchainAPI = { @@ -436,7 +436,8 @@ for (let i = 0; i < numToRead && filteredData.length < options.limit; i++) { if (!response.items[i].confirmations) { //unconfirmed transactions unconfirmedCount++; - numToRead++; + if (numToRead < response.items[i].length) + numToRead++; continue; } if (options.pattern) {