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
|
||||
}
|
||||
var snaps *snapshot.Tree
|
||||
triedb := state.NewDatabaseWithConfig(db, nil)
|
||||
triedb.EndVerkleTransition()
|
||||
for i := 0; i < n; i++ {
|
||||
triedb := state.NewDatabaseWithConfig(db, nil)
|
||||
triedb.EndVerkleTransition()
|
||||
statedb, err := state.New(parent.Root(), triedb, snaps)
|
||||
if err != nil {
|
||||
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