diff options
author | Jeffrey Wilcke <geffobscura@gmail.com> | 2016-06-18 17:17:57 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2016-06-22 16:38:25 +0800 |
commit | 7a5b571c671e70e0e4807cf971c15e2d1e09d33d (patch) | |
tree | 4ae6b6e4be80171e26aab26b88124cd87a3c53d4 /core/state/statedb.go | |
parent | 599e3c7b3f22b157c4f643a48d391cf972384099 (diff) | |
download | dexon-7a5b571c671e70e0e4807cf971c15e2d1e09d33d.tar.gz dexon-7a5b571c671e70e0e4807cf971c15e2d1e09d33d.tar.zst dexon-7a5b571c671e70e0e4807cf971c15e2d1e09d33d.zip |
test, cmd/evm, core, core/vm: illegal code hash implementation
This implements a generic approach to enabling soft forks by allowing
anyone to put in hashes of contracts that should not be interacted from.
This will help "The DAO" in their endevour to stop any whithdrawals from
any DAO contract by convincing the mining community to accept their code
hash.
Diffstat (limited to 'core/state/statedb.go')
-rw-r--r-- | core/state/statedb.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/core/state/statedb.go b/core/state/statedb.go index 3e25e0c16..79cbbaee8 100644 --- a/core/state/statedb.go +++ b/core/state/statedb.go @@ -51,6 +51,8 @@ type StateDB struct { txIndex int logs map[common.Hash]vm.Logs logSize uint + + reducedDao bool } // Create a new state from a given trie @@ -161,6 +163,14 @@ func (self *StateDB) GetCode(addr common.Address) []byte { return nil } +func (self *StateDB) GetCodeHash(addr common.Address) common.Hash { + stateObject := self.GetStateObject(addr) + if stateObject != nil { + return common.BytesToHash(stateObject.codeHash) + } + return common.Hash{} +} + func (self *StateDB) GetState(a common.Address, b common.Hash) common.Hash { stateObject := self.GetStateObject(a) if stateObject != nil { |