aboutsummaryrefslogtreecommitdiffstats
path: root/ethstate
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-10-08 17:59:44 +0800
committerobscuren <geffobscura@gmail.com>2014-10-08 17:59:44 +0800
commitb417766b36f46316cbae6fa42815f1a519e5f733 (patch)
treeaba26c0aefdcda3c3cd4b3583b84a2b2ebcf1efd /ethstate
parent0015ce1e353f52cca818d11f566b9a656fb85f24 (diff)
downloadgo-tangerine-b417766b36f46316cbae6fa42815f1a519e5f733.tar
go-tangerine-b417766b36f46316cbae6fa42815f1a519e5f733.tar.gz
go-tangerine-b417766b36f46316cbae6fa42815f1a519e5f733.tar.bz2
go-tangerine-b417766b36f46316cbae6fa42815f1a519e5f733.tar.lz
go-tangerine-b417766b36f46316cbae6fa42815f1a519e5f733.tar.xz
go-tangerine-b417766b36f46316cbae6fa42815f1a519e5f733.tar.zst
go-tangerine-b417766b36f46316cbae6fa42815f1a519e5f733.zip
Minor tweaks for poc7
Diffstat (limited to 'ethstate')
-rw-r--r--ethstate/state.go14
1 files changed, 8 insertions, 6 deletions
diff --git a/ethstate/state.go b/ethstate/state.go
index 0e87659fc..23b106e34 100644
--- a/ethstate/state.go
+++ b/ethstate/state.go
@@ -181,8 +181,6 @@ func (s *State) Reset() {
func (s *State) Sync() {
// Sync all nested states
for _, stateObject := range s.stateObjects {
- //s.UpdateStateObject(stateObject)
-
if stateObject.State == nil {
continue
}
@@ -200,9 +198,11 @@ func (self *State) Empty() {
}
func (self *State) Update() {
+ var deleted bool
for _, stateObject := range self.stateObjects {
if stateObject.remove {
self.DeleteStateObject(stateObject)
+ deleted = true
} else {
stateObject.Sync()
@@ -211,11 +211,13 @@ func (self *State) Update() {
}
// FIXME trie delete is broken
- valid, t2 := ethtrie.ParanoiaCheck(self.Trie)
- if !valid {
- statelogger.Infof("Warn: PARANOIA: Different state root during copy %x vs %x\n", self.Trie.Root, t2.Root)
+ if deleted {
+ valid, t2 := ethtrie.ParanoiaCheck(self.Trie)
+ if !valid {
+ statelogger.Infof("Warn: PARANOIA: Different state root during copy %x vs %x\n", self.Trie.Root, t2.Root)
- self.Trie = t2
+ self.Trie = t2
+ }
}
}