From 04cfb6debce3263966c6ced0afae410518873e9a Mon Sep 17 00:00:00 2001 From: pinpong Date: Mon, 2 Jan 2017 18:07:01 +0100 Subject: [PATCH] fixed getNewAddress --- src/main/java/jota/IotaAPIProxy.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/jota/IotaAPIProxy.java b/src/main/java/jota/IotaAPIProxy.java index c53a885..b3541e8 100644 --- a/src/main/java/jota/IotaAPIProxy.java +++ b/src/main/java/jota/IotaAPIProxy.java @@ -231,7 +231,7 @@ public class IotaAPIProxy { for (int i = index; ; i++) { final String newAddress = IotaAPIUtils.newAddress(seed, i, checksum); - final FindTransactionResponse response = findTransactionsByAddresses(new String[]{newAddress}); + final FindTransactionResponse response = findTransactionsByAddresses(newAddress); allAddresses.add(newAddress); if (response.getHashes().length == 0) { @@ -241,7 +241,9 @@ public class IotaAPIProxy { // If !returnAll return only the last address that was generated if (!returnAll) { - allAddresses = allAddresses.subList(allAddresses.size() - 2, allAddresses.size() - 1); + + //allAddresses = allAddresses.subList(allAddresses.size() - 2, allAddresses.size() - 1); + allAddresses = allAddresses.subList(allAddresses.size() - 1, allAddresses.size()); } return GetNewAddressResponse.create(allAddresses); }