I am sending a transaction through this code
public String transferEthByPk(String amount, String toAddress, String privateKey, Web3j web3j) { BigDecimal value = new BigDecimal(amount); Credentials credentials = EthWalletUtil.createCredentialByPrivateKey(privateKey); System.out.println("credentials"+credentials); if (credentials != null) { try { TransactionReceipt transactionReceipt= Transfer.sendFunds( web3j, credentials, toAddress, value, Convert.Unit.ETHER) .send(); String tx_Hash = transactionReceipt.getTransactionHash(); return tx_Hash; } catch (Exception e) { e.printStackTrace(); } } And I return this exception.
org.web3j.protocol.exceptions.TransactionException: Transaction receipt was not generated after 600 seconds for transaction: 0x28f2896b750e8480f87f831abd8fbdb00177527c31f5f9b4315ed8c8f374e481 This exception occurs here
TransactionReceipt transactionReceipt= Transfer.sendFunds( web3j, credentials, toAddress, value, Convert.Unit.ETHER) .send(); I can find this transactionHash in etherscan ,but it is always pending.I don't know why it is.