rm extra galloc capturing

This commit is contained in:
Sina Mahmoodi 2023-12-05 14:16:25 +03:30
parent c341c79349
commit 5190cfc5cb

View file

@ -158,12 +158,13 @@ func (ga *GenesisAlloc) hash(isVerkle bool) (common.Hash, error) {
// specification will be flushed as well.
func (ga *GenesisAlloc) flush(db ethdb.Database, triedb *trie.Database, blockhash common.Hash, bcLogger BlockchainLogger) error {
statedb, err := state.New(types.EmptyRootHash, state.NewDatabaseWithNodeDB(db, triedb), nil)
statedb.SetLogger(bcLogger)
if err != nil {
return err
}
for addr, account := range *ga {
if account.Balance != nil {
// This is not actually logged via tracer because OnGenesisBlock
// already captures the allocations.
statedb.AddBalance(addr, account.Balance, state.BalanceChangeGenesisBalance)
}
statedb.SetCode(addr, account.Code)