From 70f7a0be1187cc0e487e7b95cad238c6530d29ae Mon Sep 17 00:00:00 2001 From: obscuren Date: Thu, 16 Oct 2014 13:38:21 +0200 Subject: Use the state instead of the state object directly. If a state gets reset and you still hold a pointer to the previous, incorrect, state object you'll operate on the wrong object. Using the state to set/get objects and attributes you won't have this problem since the state will always have the correct object. --- ethstate/state_object.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'ethstate/state_object.go') diff --git a/ethstate/state_object.go b/ethstate/state_object.go index 4d2aae1a7..a5b7c65e9 100644 --- a/ethstate/state_object.go +++ b/ethstate/state_object.go @@ -104,6 +104,10 @@ func (self *StateObject) SetStorage(key *big.Int, value *ethutil.Value) { self.SetState(key.Bytes(), value) } +func (self *StateObject) Storage() map[string]*ethutil.Value { + return self.storage +} + func (self *StateObject) GetState(k []byte) *ethutil.Value { key := ethutil.LeftPadBytes(k, 32) -- cgit v1.2.3