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:
Brent
2019-03-27 08:39:25 -04:00
committed by Felix Lange
parent 42e2c586fd
commit 7fb89697fd
8 changed files with 59 additions and 2 deletions

View File

@ -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