mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-03-06 19:35:04 +00:00
move stuff around
This commit is contained in:
parent
a0ad1eecc0
commit
c61d2d307d
1 changed files with 2 additions and 2 deletions
|
|
@ -308,7 +308,6 @@ func (db *CachingDB) ReadersWithCacheStats(stateRoot common.Hash) (ReaderWithSta
|
|||
// OpenTrie opens the main account trie at a specific root hash.
|
||||
func (db *CachingDB) OpenTrie(root common.Hash) (Trie, error) {
|
||||
reader, err := db.triedb.StateReader(root)
|
||||
flatReader := newFlatReader(reader)
|
||||
if err != nil {
|
||||
tr, err := trie.NewStateTrie(trie.StateTrieID(root), db.triedb)
|
||||
if err != nil {
|
||||
|
|
@ -316,13 +315,14 @@ func (db *CachingDB) OpenTrie(root common.Hash) (Trie, error) {
|
|||
}
|
||||
return tr, nil
|
||||
}
|
||||
flatReader := newFlatReader(reader)
|
||||
|
||||
ts := LoadTransitionState(flatReader, root)
|
||||
if isTransitionActive(flatReader) || db.triedb.IsVerkle() {
|
||||
bt, err := bintrie.NewBinaryTrie(root, db.triedb)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("could not open the overlay tree: %w", err)
|
||||
}
|
||||
ts := LoadTransitionState(flatReader, root)
|
||||
if !ts.InTransition() {
|
||||
// Transition complete, use BinaryTrie only
|
||||
return bt, nil
|
||||
|
|
|
|||
Loading…
Reference in a new issue