Skip to content

Commit 196f50c

Browse files
committed
core/state: skip OpenTrie error for HistoricDB (temporary)
NewWithReader previously returned an error when OpenTrie failed. For HistoricDB, skip the error to allow construction to proceed. A TODO is included to remove once HistoricDB implements OpenTrie.
1 parent 607cb42 commit 196f50c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

core/state/statedb.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,10 @@ func New(root common.Hash, db Database) (*StateDB, error) {
187187
func NewWithReader(root common.Hash, db Database, reader Reader) (*StateDB, error) {
188188
tr, err := db.OpenTrie(root)
189189
if err != nil {
190-
return nil, err
190+
// TODO: remove this check when HistoricDB implements OpenTrie
191+
if _, ok := db.(*HistoricDB); !ok {
192+
return nil, err
193+
}
191194
}
192195
sdb := &StateDB{
193196
trie: tr,

0 commit comments

Comments
 (0)