0

How could I get the real status from EthBlock.TransactionObject(replayPastBlocksFlowable) in Web3j as same as Etherscan? I couldn't find any status items from Web3j response, how does Etherscan check the status?

https://etherscan.io/tx/0x3b89a03322520c517b36573fff64913bd9eee048e4d754a8d052d68ded78c3d2 enter image description here

Printing EthBlock.TransactionObject from Web3j

{
    "blockHash": "0x2010f10af7babf7c3a0e19b2257820ba5e317b3d322409605a0b2d330af88444",
    "transactionIndex": 204,
    "nonce": 1146,
    "input": "0x",
    "r": "0xc084063d387979c37488d0b22f4ad1c767efcf171f2a1ffd218177d4d12e5950",
    "s": "0x521aa34adbfdb2d5b80b58bb22c8e3899d95c638819bbcbda10bfe464d65ed9f",
    "v": 27,
    "blockNumber": 11151512,
    "gas": 21000,
    "from": "0x00a131e4c53066f5846372e3b0beac4f0b3310e0",
    "to": "0xdc7cd290867032e6a720334dc47f7a0329385adb",
    "value": 255000000000000000,
    "hash": "0x3b89a03322520c517b36573fff64913bd9eee048e4d754a8d052d68ded78c3d2",
    "gasPrice": 81400000000
}
1

What Etherscan checks, and what you are looking for, is the transaction receipt, which includes the status.

There is a JSON-RPC call for this : eth_getTransactionReceipt (see here https://eth.wiki/json-rpc/API).

I don't know web3j but the documentation refers to a method named Web3j.ethGetTransactionReceipt(<txHash>) (https://docs.web3j.io/transactions/transaction_mechanisms/).

Also have a look to this : How can I get the TxReceipt of a transaction with web3j?.

1
  • Thanks, it works. EthBlock.TransactionObject does not include the receipt so that I have to get the TransactionReceipt once more by the tx_hash. – Nate Zheng Oct 30 '20 at 23:32

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.