diff options
author | obscuren <geffobscura@gmail.com> | 2014-09-15 21:42:12 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-09-15 21:42:12 +0800 |
commit | 33a0dec8a157b9687ca6038f4deb011f3f1f7bdc (patch) | |
tree | 197b792e06dc3952df93957a39fdf6e44582ac96 /ethstate/state.go | |
parent | 2f614900e82036e3e8f6f6a714efc43e09aca830 (diff) | |
download | go-tangerine-33a0dec8a157b9687ca6038f4deb011f3f1f7bdc.tar.gz go-tangerine-33a0dec8a157b9687ca6038f4deb011f3f1f7bdc.tar.zst go-tangerine-33a0dec8a157b9687ca6038f4deb011f3f1f7bdc.zip |
Improved catching up and refactored
Diffstat (limited to 'ethstate/state.go')
-rw-r--r-- | ethstate/state.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ethstate/state.go b/ethstate/state.go index 42bbf021b..0e87659fc 100644 --- a/ethstate/state.go +++ b/ethstate/state.go @@ -3,7 +3,6 @@ package ethstate import ( "math/big" - "github.com/ethereum/eth-go/ethcrypto" "github.com/ethereum/eth-go/ethlog" "github.com/ethereum/eth-go/ethtrie" "github.com/ethereum/eth-go/ethutil" @@ -66,7 +65,9 @@ func (self *State) GetCode(addr []byte) []byte { func (self *State) UpdateStateObject(stateObject *StateObject) { addr := stateObject.Address() - ethutil.Config.Db.Put(ethcrypto.Sha3Bin(stateObject.Code), stateObject.Code) + if len(stateObject.CodeHash()) > 0 { + ethutil.Config.Db.Put(stateObject.CodeHash(), stateObject.Code) + } self.Trie.Update(string(addr), string(stateObject.RlpEncode())) } |