mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 18:02:24 +00:00
triedb/pathdb: polish
This commit is contained in:
parent
a49e72564d
commit
6b7872ccf1
1 changed files with 2 additions and 3 deletions
|
|
@ -94,7 +94,7 @@ func (db *Database) loadLayers() layer {
|
||||||
// Retrieve the root node of persistent state.
|
// Retrieve the root node of persistent state.
|
||||||
root, err := nodeToHash(rawdb.ReadAccountTrieNode(db.diskdb, nil), db.isVerkle)
|
root, err := nodeToHash(rawdb.ReadAccountTrieNode(db.diskdb, nil), db.isVerkle)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Crit("Invalid root verkle node", "err", err)
|
log.Crit("Failed to compute root node hash", "err", err)
|
||||||
}
|
}
|
||||||
// Load the layers by resolving the journal
|
// Load the layers by resolving the journal
|
||||||
head, err := db.loadJournal(root)
|
head, err := db.loadJournal(root)
|
||||||
|
|
@ -263,8 +263,7 @@ func (db *Database) Journal(root common.Hash) error {
|
||||||
}
|
}
|
||||||
// Firstly write out the metadata of journal
|
// Firstly write out the metadata of journal
|
||||||
journal := new(bytes.Buffer)
|
journal := new(bytes.Buffer)
|
||||||
err := rlp.Encode(journal, journalVersion)
|
if err := rlp.Encode(journal, journalVersion); err != nil {
|
||||||
if err != nil {
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
// Secondly write out the state root in disk, ensure all layers
|
// Secondly write out the state root in disk, ensure all layers
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue