mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-16 00:43:46 +00:00
rm extra galloc capturing
This commit is contained in:
parent
c341c79349
commit
5190cfc5cb
1 changed files with 2 additions and 1 deletions
|
|
@ -158,12 +158,13 @@ func (ga *GenesisAlloc) hash(isVerkle bool) (common.Hash, error) {
|
||||||
// specification will be flushed as well.
|
// specification will be flushed as well.
|
||||||
func (ga *GenesisAlloc) flush(db ethdb.Database, triedb *trie.Database, blockhash common.Hash, bcLogger BlockchainLogger) error {
|
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, err := state.New(types.EmptyRootHash, state.NewDatabaseWithNodeDB(db, triedb), nil)
|
||||||
statedb.SetLogger(bcLogger)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
for addr, account := range *ga {
|
for addr, account := range *ga {
|
||||||
if account.Balance != nil {
|
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.AddBalance(addr, account.Balance, state.BalanceChangeGenesisBalance)
|
||||||
}
|
}
|
||||||
statedb.SetCode(addr, account.Code)
|
statedb.SetCode(addr, account.Code)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue