CopyTrie returns an independent copy of the given trie.
(t Trie)
| 126 | |
| 127 | // CopyTrie returns an independent copy of the given trie. |
| 128 | func (db *cachingDB) CopyTrie(t Trie) Trie { |
| 129 | switch t := t.(type) { |
| 130 | case cachedTrie: |
| 131 | return cachedTrie{t.SecureTrie.Copy(), db} |
| 132 | case *trie.SecureTrie: |
| 133 | return t.Copy() |
| 134 | default: |
| 135 | panic(fmt.Errorf("unknown trie type %T", t)) |
| 136 | } |
| 137 | } |
| 138 | |
| 139 | // ContractCode retrieves a particular contract's code. |
| 140 | func (db *cachingDB) ContractCode(addrHash, codeHash common.Hash) ([]byte, error) { |