mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 09:53:48 +00:00
don't panic if trie type is unknown, return identity instead
This commit is contained in:
parent
75f847390f
commit
6139d9c22f
1 changed files with 4 additions and 3 deletions
|
|
@ -17,8 +17,6 @@
|
|||
package state
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/common/lru"
|
||||
"github.com/ethereum/go-ethereum/core/rawdb"
|
||||
|
|
@ -274,6 +272,9 @@ func mustCopyTrie(t Trie) Trie {
|
|||
case *trie.VerkleTrie:
|
||||
return t.Copy()
|
||||
default:
|
||||
panic(fmt.Errorf("unknown trie type %T", t))
|
||||
// Rare case: Return the identity if the trie type is not directly
|
||||
// implemented within go-ethereum. Any copy logic would need to be handled
|
||||
// by the caller outside go-ethereum.
|
||||
return t
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue