ignore errors from getbundle

This commit is contained in:
AZ
2017-01-03 10:56:58 +01:00
parent 29c5c26b0a
commit 8c0833a9ba
2 changed files with 16 additions and 12 deletions
+16 -11
View File
@@ -314,20 +314,25 @@ public class IotaAPIProxy {
if (gisr == null || gisr.getStates() == null || gisr.getStates().length == 0) return null;
}
for (String trx : tailTxArray) {
GetBundleResponse bundleResponse = getBundle(trx);
// TODO: review possibly dirty WA
if (bundleResponse == null) continue;
Bundle gbr = new Bundle(bundleResponse.getTransactions(), bundleResponse.getTransactions().size());
if (gbr != null && gbr.getTransactions() != null) {
if (inclusionStates) {
boolean thisInclusion = gisr.getStates()[Arrays.asList(tailTxArray).indexOf(trx)];
for (Transaction t : gbr.getTransactions()) {
t.setPersistence(thisInclusion);
try {
GetBundleResponse bundleResponse = getBundle(trx);
// TODO: review possibly dirty WA
if (bundleResponse == null) continue;
Bundle gbr = new Bundle(bundleResponse.getTransactions(), bundleResponse.getTransactions().size());
if (gbr != null && gbr.getTransactions() != null) {
if (inclusionStates) {
boolean thisInclusion = gisr.getStates()[Arrays.asList(tailTxArray).indexOf(trx)];
for (Transaction t : gbr.getTransactions()) {
t.setPersistence(thisInclusion);
}
}
finalBundles.add(gbr);
}
finalBundles.add(gbr);
// If error returned from getBundle, simply ignore it because the bundle was most likely incorrect
}catch(Exception e){
log.warn("GetBundleError: ",e);
}
}
Collections.sort(finalBundles, new Comparator<Bundle>() {
-1
View File
@@ -163,7 +163,6 @@ public class Signing {
digests[i * 243 + j] = digestBuffer[j];
}
}
//System.out.println(Arrays.toString(digests).replaceAll("\\s+",""));
String address = Converter.trytes(address(digests));
return (expectedAddress.equals(address));