Say I make some transaction with web3 which is picked up and validated by two miners A
and B
. A
produced what turned out to be an uncle block and B
contributed to the main-chain. If web3 gave me the receipt for my transaction mined by A
, is there some way to get the receipt for the transaction in the block that miner B
added to the main-chain?
1 Answer
Call getTransactionReceipt
again with the transaction hash. The Ethereum client/Infura should return a valid receipt that belong to the main chain.
-
So the transaction hash is same regardless the block it is included in and can therefore be retrieved in any case so long it is included in some block on the main chain or otherwise?– ConvileyApr 30, 2020 at 7:24
-
Yes, you are correct. The transaction hash is calculated from the signed transaction, only depends on transaction data and transaction signature.– Ismael ♦Apr 30, 2020 at 15:29