deleteStateObject removes the given object from the state trie.
(obj *stateObject)
| 727 | |
| 728 | // deleteStateObject removes the given object from the state trie. |
| 729 | func (s *StateDB) deleteStateObject(obj *stateObject) { |
| 730 | if s.noTrie { |
| 731 | return |
| 732 | } |
| 733 | // Track the amount of time wasted on deleting the account from the trie |
| 734 | if metrics.EnabledExpensive { |
| 735 | defer func(start time.Time) { s.AccountUpdates += time.Since(start) }(time.Now()) |
| 736 | } |
| 737 | // Delete the account from the trie |
| 738 | addr := obj.Address() |
| 739 | if err := s.trie.DeleteAccount(addr); err != nil { |
| 740 | s.setError(fmt.Errorf("deleteStateObject (%x) error: %v", addr[:], err)) |
| 741 | } |
| 742 | } |
| 743 | |
| 744 | // getStateObject retrieves a state object given by the address, returning nil if |
| 745 | // the object is not found or was deleted in this execution context. If you need |
no test coverage detected