mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-10 17:01:35 +00:00
fix UBT snapshot load
This commit is contained in:
parent
690c16fb5c
commit
062dfa16c9
1 changed files with 13 additions and 1 deletions
|
|
@ -161,7 +161,19 @@ func loadGenerator(db ethdb.KeyValueReader, hash nodeHasher) (*journalGenerator,
|
||||||
// loadLayers loads a pre-existing state layer backed by a key-value store.
|
// loadLayers loads a pre-existing state layer backed by a key-value store.
|
||||||
func (db *Database) loadLayers() layer {
|
func (db *Database) loadLayers() layer {
|
||||||
// Retrieve the root node of persistent state.
|
// Retrieve the root node of persistent state.
|
||||||
root, err := db.hasher(rawdb.ReadAccountTrieNode(db.diskdb, nil))
|
var (
|
||||||
|
root common.Hash
|
||||||
|
err error
|
||||||
|
)
|
||||||
|
if db.isUBT {
|
||||||
|
root = rawdb.ReadSnapshotRoot(db.diskdb)
|
||||||
|
if root == (common.Hash{}) {
|
||||||
|
root = types.EmptyBinaryHash
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
blob := rawdb.ReadAccountTrieNode(db.diskdb, nil)
|
||||||
|
root, err = db.hasher(blob)
|
||||||
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Crit("Failed to compute node hash", "err", err)
|
log.Crit("Failed to compute node hash", "err", err)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue