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

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