From 955bf59282417eaa3879b2042f27c8071b94a00e Mon Sep 17 00:00:00 2001 From: pinpong Date: Fri, 29 Sep 2017 16:00:48 +0200 Subject: [PATCH] fixed prepareTransfers thx @th0br0 --- src/main/java/jota/IotaAPI.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/main/java/jota/IotaAPI.java b/src/main/java/jota/IotaAPI.java index e03653e..787eedb 100644 --- a/src/main/java/jota/IotaAPI.java +++ b/src/main/java/jota/IotaAPI.java @@ -457,10 +457,10 @@ public class IotaAPI extends IotaAPICore { String[] balances = balancesResponse.getBalances(); List confirmedInputs = new ArrayList<>(); - int totalBalance = 0; + long totalBalance = 0; int i = 0; for (String balance : balances) { - long thisBalance = Integer.parseInt(balance); + long thisBalance = Long.parseLong(balance); // If input has balance, add it to confirmedInputs if (thisBalance > 0) { @@ -904,8 +904,6 @@ public class IotaAPI extends IotaAPICore { */ public List initiateTransfer(int securitySum, final String inputAddress, String remainderAddress, final List transfers, boolean testMode) throws InvalidAddressException, InvalidBundleException, InvalidTransferException { - StopWatch sw = new StopWatch(); - // If message or tag is not supplied, provide it // Also remove the checksum of the address if it's there @@ -1006,7 +1004,7 @@ public class IotaAPI extends IotaAPICore { long totalBalance = 0; for (String balance : balances) { - long thisBalance = Integer.parseInt(balance); + long thisBalance = Long.parseLong(balance); totalBalance += thisBalance; } @@ -1157,4 +1155,4 @@ public class IotaAPI extends IotaAPICore { return new IotaAPI(this); } } -} +} \ No newline at end of file