Retry to get the TX result even when it is not found
It may take some time for TX to populate to other nodes
@@ -213,7 +213,9 @@ public class TransactionHandler {
try {
return iconService.getTransactionResult(txHash).execute();
} catch (RpcError e) {
- if (e.getCode() == -31002 || e.getCode() == -31003) { // pending or executing
+ if (e.getCode() == -31002 /* pending */
+ || e.getCode() == -31003 /* executing */
+ || e.getCode() == -31004 /* not found */) {
if (limitTime < System.currentTimeMillis()) {
throw new ResultTimeoutException(txHash);
}
@@ -226,6 +228,7 @@ public class TransactionHandler {
}
continue;
}
+ LOG.warning("RpcError: code(" + e.getCode() + ") message(" + e.getMessage() + ")");
throw e;
}
}
