@@ -127,7 +127,7 @@ func (self *State) GetOrNewStateObject(addr []byte) *StateObject {
127127}
128128
129129func (self * State ) NewStateObject (addr []byte ) * StateObject {
130- statelogger .Infof ("(+) %x\n " , addr )
130+ // statelogger.Infof("(+) %x\n", addr)
131131
132132 stateObject := NewStateObject (addr )
133133 self .stateObjects [string (addr )] = stateObject
@@ -206,84 +206,3 @@ func (m *Manifest) AddStorageChange(stateObject *StateObject, storageAddr []byte
206206
207207 m .storageChanges [string (stateObject .Address ())][string (storageAddr )] = storage
208208}
209-
210- /*
211-
212- // Resets the trie and all siblings
213- func (s *State) Reset() {
214- s.trie.Undo()
215-
216- // Reset all nested states
217- for _, state := range s.states {
218- state.Reset()
219- }
220- }
221-
222- // Syncs the trie and all siblings
223- func (s *State) Sync() {
224- // Sync all nested states
225- for _, state := range s.states {
226- state.Sync()
227- }
228-
229- s.trie.Sync()
230- }
231- func (s *State) GetStateObject(addr []byte) *StateObject {
232- data := s.trie.Get(string(addr))
233- if data == "" {
234- return nil
235- }
236-
237- stateObject := NewStateObjectFromBytes(addr, []byte(data))
238-
239- // Check if there's a cached state for this contract
240- cachedStateObject := s.states[string(addr)]
241- if cachedStateObject != nil {
242- //fmt.Printf("get cached #%d %x addr: %x\n", cachedStateObject.trie.Cache().Len(), cachedStateObject.Root(), addr[0:4])
243- stateObject.state = cachedStateObject
244- }
245-
246- return stateObject
247- }
248-
249- // Updates any given state object
250- func (s *State) UpdateStateObject(object *StateObject) {
251- addr := object.Address()
252-
253- if object.state != nil && s.states[string(addr)] == nil {
254- s.states[string(addr)] = object.state
255- }
256-
257- ethutil.Config.Db.Put(ethutil.Sha3Bin(object.Script()), object.Script())
258-
259- s.trie.Update(string(addr), string(object.RlpEncode()))
260-
261- s.manifest.AddObjectChange(object)
262- }
263-
264- func (s *State) GetAccount(addr []byte) (account *StateObject) {
265- data := s.trie.Get(string(addr))
266- if data == "" {
267- account = NewAccount(addr, big.NewInt(0))
268- } else {
269- account = NewStateObjectFromBytes(addr, []byte(data))
270- }
271-
272- // Check if there's a cached state for this contract
273- cachedStateObject := s.states[string(addr)]
274- if cachedStateObject != nil {
275- account.state = cachedStateObject
276- }
277-
278- return
279- }
280-
281- func (s *State) Copy() *State {
282- state := NewState(s.trie.Copy())
283- for k, subState := range s.states {
284- state.states[k] = subState.Copy()
285- }
286-
287- return state
288- }
289- */
0 commit comments