aboutsummaryrefslogtreecommitdiffstats
path: root/ethchain/state.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-07-01 02:03:31 +0800
committerobscuren <geffobscura@gmail.com>2014-07-01 02:03:31 +0800
commited276cd7c241749a9cf8add4e2fae3d3608a7ea4 (patch)
tree40416177aeac9874e0eecdb7194db9bc13e39174 /ethchain/state.go
parent82272ee08a7d72be1cc0947b6a0e8096a0353362 (diff)
downloadgo-tangerine-ed276cd7c241749a9cf8add4e2fae3d3608a7ea4.tar
go-tangerine-ed276cd7c241749a9cf8add4e2fae3d3608a7ea4.tar.gz
go-tangerine-ed276cd7c241749a9cf8add4e2fae3d3608a7ea4.tar.bz2
go-tangerine-ed276cd7c241749a9cf8add4e2fae3d3608a7ea4.tar.lz
go-tangerine-ed276cd7c241749a9cf8add4e2fae3d3608a7ea4.tar.xz
go-tangerine-ed276cd7c241749a9cf8add4e2fae3d3608a7ea4.tar.zst
go-tangerine-ed276cd7c241749a9cf8add4e2fae3d3608a7ea4.zip
Added Paranoia check for VM execution
Diffstat (limited to 'ethchain/state.go')
-rw-r--r--ethchain/state.go81
1 files changed, 0 insertions, 81 deletions
diff --git a/ethchain/state.go b/ethchain/state.go
index e28b91909..51d86fe2a 100644
--- a/ethchain/state.go
+++ b/ethchain/state.go
@@ -204,84 +204,3 @@ func (m *Manifest) AddStorageChange(stateObject *StateObject, storageAddr []byte
m.storageChanges[string(stateObject.Address())][string(storageAddr)] = storage
}
-
-/*
-
-// Resets the trie and all siblings
-func (s *State) Reset() {
- s.trie.Undo()
-
- // Reset all nested states
- for _, state := range s.states {
- state.Reset()
- }
-}
-
-// Syncs the trie and all siblings
-func (s *State) Sync() {
- // Sync all nested states
- for _, state := range s.states {
- state.Sync()
- }
-
- s.trie.Sync()
-}
-func (s *State) GetStateObject(addr []byte) *StateObject {
- data := s.trie.Get(string(addr))
- if data == "" {
- return nil
- }
-
- stateObject := NewStateObjectFromBytes(addr, []byte(data))
-
- // Check if there's a cached state for this contract
- cachedStateObject := s.states[string(addr)]
- if cachedStateObject != nil {
- //fmt.Printf("get cached #%d %x addr: %x\n", cachedStateObject.trie.Cache().Len(), cachedStateObject.Root(), addr[0:4])
- stateObject.state = cachedStateObject
- }
-
- return stateObject
-}
-
-// Updates any given state object
-func (s *State) UpdateStateObject(object *StateObject) {
- addr := object.Address()
-
- if object.state != nil && s.states[string(addr)] == nil {
- s.states[string(addr)] = object.state
- }
-
- ethutil.Config.Db.Put(ethutil.Sha3Bin(object.Script()), object.Script())
-
- s.trie.Update(string(addr), string(object.RlpEncode()))
-
- s.manifest.AddObjectChange(object)
-}
-
-func (s *State) GetAccount(addr []byte) (account *StateObject) {
- data := s.trie.Get(string(addr))
- if data == "" {
- account = NewAccount(addr, big.NewInt(0))
- } else {
- account = NewStateObjectFromBytes(addr, []byte(data))
- }
-
- // Check if there's a cached state for this contract
- cachedStateObject := s.states[string(addr)]
- if cachedStateObject != nil {
- account.state = cachedStateObject
- }
-
- return
-}
-
-func (s *State) Copy() *State {
- state := NewState(s.trie.Copy())
- for k, subState := range s.states {
- state.states[k] = subState.Copy()
- }
-
- return state
-}
-*/