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. --- miner/worker.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'miner') diff --git a/miner/worker.go b/miner/worker.go index 48473796b..80c1771b6 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -566,6 +566,11 @@ func (w *worker) resultLoop() { logs []*types.Log ) for i, receipt := range task.receipts { + // add block location fields + receipt.BlockHash = hash + receipt.BlockNumber = block.Number() + receipt.TransactionIndex = uint(i) + receipts[i] = new(types.Receipt) *receipts[i] = *receipt // Update the block hash in all logs since it is now available and not when the -- cgit v1.2.3