0

I am trying to find the transaction count of an address using ethGetTransactionCount method but it's returning 0 value. What the issue over here. I'm using infura mainnet and web3j in maven

/Find the current transaction count/
EthGetTransactionCount txnCount = web3j.ethGetTransactionCount("0xa9e4E3b1DA2462752AeA980698c335E70E9AB26C"
,DefaultBlockParameterName.LATEST).sendAsync().get();
BigInteger nonce = txnCount.getTransactionCount();
System.out.println("Transaction Count "+ nonce);
  • 1. getting 0 tx count is totally legitimate count 2. Since you do have some tx in there, I think your code is constructed correctly – rstormsf Jun 8 '18 at 8:25
1

From https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_gettransactioncount:

Returns the number of transactions sent from an address.

The address 0xa9e4E3b1DA2462752AeA980698c335E70E9AB26C has sent 0 transactions, so the correct result is, in fact, 0.

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.