mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 18:32:23 +00:00
refactor: move trieDB creation outside of block-making loop (#354)
This commit is contained in:
parent
9be95a24f4
commit
cc48d57e15
1 changed files with 2 additions and 2 deletions
|
|
@ -429,9 +429,9 @@ func GenerateVerkleChain(config *params.ChainConfig, parent *types.Block, engine
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
var snaps *snapshot.Tree
|
var snaps *snapshot.Tree
|
||||||
for i := 0; i < n; i++ {
|
|
||||||
triedb := state.NewDatabaseWithConfig(db, nil)
|
triedb := state.NewDatabaseWithConfig(db, nil)
|
||||||
triedb.EndVerkleTransition()
|
triedb.EndVerkleTransition()
|
||||||
|
for i := 0; i < n; i++ {
|
||||||
statedb, err := state.New(parent.Root(), triedb, snaps)
|
statedb, err := state.New(parent.Root(), triedb, snaps)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(fmt.Sprintf("could not find state for block %d: err=%v, parent root=%x", i, err, parent.Root()))
|
panic(fmt.Sprintf("could not find state for block %d: err=%v, parent root=%x", i, err, parent.Root()))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue