aboutsummaryrefslogtreecommitdiffstats
path: root/ethstate/state.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-09-15 21:42:12 +0800
committerobscuren <geffobscura@gmail.com>2014-09-15 21:42:12 +0800
commit33a0dec8a157b9687ca6038f4deb011f3f1f7bdc (patch)
tree197b792e06dc3952df93957a39fdf6e44582ac96 /ethstate/state.go
parent2f614900e82036e3e8f6f6a714efc43e09aca830 (diff)
downloaddexon-33a0dec8a157b9687ca6038f4deb011f3f1f7bdc.tar.gz
dexon-33a0dec8a157b9687ca6038f4deb011f3f1f7bdc.tar.zst
dexon-33a0dec8a157b9687ca6038f4deb011f3f1f7bdc.zip
Improved catching up and refactored
Diffstat (limited to 'ethstate/state.go')
-rw-r--r--ethstate/state.go5
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()))
}