From 7fb89697fd248879a0fd1ac0b925b91b3dda0e22 Mon Sep 17 00:00:00 2001 From: Brent Date: Wed, 27 Mar 2019 08:39:25 -0400 Subject: 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. --- core/state_processor.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'core/state_processor.go') diff --git a/core/state_processor.go b/core/state_processor.go index 503a35d16..6f2a45120 100644 --- a/core/state_processor.go +++ b/core/state_processor.go @@ -121,6 +121,9 @@ func ApplyTransaction(config *params.ChainConfig, bc ChainContext, author *commo // Set the receipt logs and create a bloom for filtering receipt.Logs = statedb.GetLogs(tx.Hash()) receipt.Bloom = types.CreateBloom(types.Receipts{receipt}) + receipt.BlockHash = statedb.BlockHash() + receipt.BlockNumber = header.Number + receipt.TransactionIndex = uint(statedb.TxIndex()) return receipt, gas, err } -- cgit v1.2.3