diff options
author | obscuren <geffobscura@gmail.com> | 2014-10-16 19:38:21 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-10-16 19:38:21 +0800 |
commit | 70f7a0be1187cc0e487e7b95cad238c6530d29ae (patch) | |
tree | f7b2787bf598db75ae6750e0d7c3fbf1fdfb4ede /ethstate/state_object.go | |
parent | 311c6f8a3fed5ac03ee4b442fd0f420072bc41b4 (diff) | |
download | go-tangerine-70f7a0be1187cc0e487e7b95cad238c6530d29ae.tar go-tangerine-70f7a0be1187cc0e487e7b95cad238c6530d29ae.tar.gz go-tangerine-70f7a0be1187cc0e487e7b95cad238c6530d29ae.tar.bz2 go-tangerine-70f7a0be1187cc0e487e7b95cad238c6530d29ae.tar.lz go-tangerine-70f7a0be1187cc0e487e7b95cad238c6530d29ae.tar.xz go-tangerine-70f7a0be1187cc0e487e7b95cad238c6530d29ae.tar.zst go-tangerine-70f7a0be1187cc0e487e7b95cad238c6530d29ae.zip |
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.
Diffstat (limited to 'ethstate/state_object.go')
-rw-r--r-- | ethstate/state_object.go | 4 |
1 files changed, 4 insertions, 0 deletions
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) |