Reset state when a transition fails

This commit is contained in:
obscuren
2014-06-19 13:41:17 +02:00
parent 509389be97
commit 731f55a05d
2 changed files with 94 additions and 47 deletions

View File

@ -78,11 +78,16 @@ func (s *State) EachStorage(cb ethutil.EachCallback) {
it.Each(cb)
}
func (self *State) ResetStateObject(stateObject *StateObject) {
stateObject.state.Reset()
delete(self.stateObjects, string(stateObject.Address()))
}
func (self *State) UpdateStateObject(stateObject *StateObject) {
addr := stateObject.Address()
if self.stateObjects[string(addr)] == nil {
panic("?")
self.stateObjects[string(addr)] = stateObject
}