iota-java icon indicating copy to clipboard operation
iota-java copied to clipboard

IotaAPI.getTransfers() always throws ArgumentException for specific (seed, index) combinations

Open vuapo-eth opened this issue 7 years ago • 2 comments

When calling this method:

api.getTransfers(seed, 2, index, index+1, false);

I frequently receive this exception:

jota.error.ArgumentException: [{"error":"Could not complete request","duration":43}]
    at jota.IotaAPICore.wrapCheckedException(IotaAPICore.java:71)
    at jota.IotaAPICore.getTrytes(IotaAPICore.java:292)
    at jota.IotaAPI.findTransactionsObjectsByHashes(IotaAPI.java:268)
    at jota.IotaAPI.findTransactionObjectsByAddresses(IotaAPI.java:297)
    at jota.IotaAPI.bundlesFromAddresses(IotaAPI.java:132)
    at jota.IotaAPI.getTransfers(IotaAPI.java:116)

Furthermore, this exception only happens for very specific (seed, index) combinations. So it works for the paramers (seed = 'PDIZO...', index = 29), but not for (seed = 'PDIZO...', index = 30). I can call the latter one a hundred times, yet the exception will continue to be thrown every single time. I have tried connecting to different nodes, but this did not help either.

For obvious reason, I will not post any explicit seed in here. If, however, any developer of this repository wants to replicate the error, I will happily provide you with an example seed with a rather low balance.

Also, I'm using the latest snapshot of v0.9.11, not sure whether that's the issue. I'm 80% sure it already happened to me when using v0.9.6.

vuapo-eth avatar Feb 15 '18 13:02 vuapo-eth

Whether this is a bug depends on how many transfers are on the Address (index) you are querying.

if calling seed = 'PDIZO...', index = 30 but there are only 20 transfers on the address, then ArgumentException is correct, in the same way Java will always return indexOutOfBoundException if your calling list.get(20) and the list only consists of 10 items.

Probably not a bug, more feedback/info needed.

Addition: yes a snapshot will affect this as all transfers will have been removed from that address leaving just the balance on the address.

runplay avatar Apr 24 '18 10:04 runplay

@mikrohash is this issue still relevant? Can you provide a sample? meanwhile the code base is a bit different.

ezienecker avatar Jun 05 '20 11:06 ezienecker