core/types: add block location fields to receipt (#17662)
Solves #15210 without changing consensus, in a backwards compatible way, by adding tx inclusion information to the Receipt struct.
This commit is contained in:
@ -810,6 +810,11 @@ func SetReceiptsData(config *params.ChainConfig, block *types.Block, receipts ty
|
||||
// The transaction hash can be retrieved from the transaction itself
|
||||
receipts[j].TxHash = transactions[j].Hash()
|
||||
|
||||
// block location fields
|
||||
receipts[j].BlockHash = block.Hash()
|
||||
receipts[j].BlockNumber = block.Number()
|
||||
receipts[j].TransactionIndex = uint(j)
|
||||
|
||||
// The contract address can be derived from the transaction itself
|
||||
if transactions[j].To() == nil {
|
||||
// Deriving the signer is expensive, only do if it's actually needed
|
||||
|
Reference in New Issue
Block a user