aboutsummaryrefslogtreecommitdiffstats
path: root/ethchain/state.go
diff options
context:
space:
mode:
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
-}
-*/