Skip to content

Instantly share code, notes, and snippets.

@obscuren
Created October 13, 2016 10:08
Show Gist options
  • Save obscuren/37ab268e7e159ad3ea884a141546a67d to your computer and use it in GitHub Desktop.
Save obscuren/37ab268e7e159ad3ea884a141546a67d to your computer and use it in GitHub Desktop.
diff --git a/core/state/statedb.go b/core/state/statedb.go
index ec9e939..465e986 100644
--- a/core/state/statedb.go
+++ b/core/state/statedb.go
@@ -516,11 +516,15 @@ func (self *StateDB) GetRefund() *big.Int {
func (s *StateDB) IntermediateRoot() common.Hash {
for addr, _ := range s.stateObjectsDirty {
stateObject := s.stateObjects[addr]
- if stateObject.suicided {
+ if /* some block && */ (stateObject.data == Account{}) {
s.deleteStateObject(stateObject)
} else {
- stateObject.updateRoot(s.db)
- s.updateStateObject(stateObject)
+ if stateObject.suicided {
+ s.deleteStateObject(stateObject)
+ } else {
+ stateObject.updateRoot(s.db)
+ s.updateStateObject(stateObject)
+ }
}
}
// Invalidate journal because reverting across transactions is not allowed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment