1

I used the following code to send a transaction and get transaction status.However, sometimes the transaction is not minded at all. But the transactionReceipt get the same value "NULL" for both of the "not mined" and pending status.

Is there a way to get different values for these 2 status so we can resubmit the transaction when the status is not mined??

EthSendTransaction ethSendTransaction = web3j.ethSendRawTransaction(hexValue).sendAsync().get()
EthGetTransactionReceipt transactionReceipt = web3j.ethGetTransactionReceipt(transactionHash).sendAsync().get();
0

Referring to web3.eth.getTransaction, You could check on its return for blockNumber value. If the blockNumber value is null means the transaction is still pending.

More info here: http://web3js.readthedocs.io/en/1.0/web3-eth.html#gettransaction

  • I know how to get the pending transaction.But how to check if the transaction is being mined or not? Sometimes, the transaction is not even being mined and the blocknumber value is also null. – vaj oja Jul 8 '18 at 6:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.