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/statedb.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'core/state') diff --git a/core/state/statedb.go b/core/state/statedb.go index a299cdb64..db2e0d5e0 100644 --- a/core/state/statedb.go +++ b/core/state/statedb.go @@ -237,6 +237,16 @@ func (self *StateDB) GetNonce(addr common.Address) uint64 { return 0 } +// TxIndex returns the current transaction index set by Prepare. +func (self *StateDB) TxIndex() int { + return self.txIndex +} + +// BlockHash returns the current block hash set by Prepare. +func (self *StateDB) BlockHash() common.Hash { + return self.bhash +} + func (self *StateDB) GetCode(addr common.Address) []byte { stateObject := self.getStateObject(addr) if stateObject != nil { -- cgit v1.2.3