Unverified Commit 6dc9cdf1 authored by Felix Lange's avatar Felix Lange Committed by GitHub

core: support null balance in genesis (#28005)

parent 56d23666
......@@ -130,7 +130,9 @@ func (ga *GenesisAlloc) deriveHash() (common.Hash, error) {
return common.Hash{}, err
}
for addr, account := range *ga {
statedb.AddBalance(addr, account.Balance)
if account.Balance != nil {
statedb.AddBalance(addr, account.Balance)
}
statedb.SetCode(addr, account.Code)
statedb.SetNonce(addr, account.Nonce)
for key, value := range account.Storage {
......@@ -149,7 +151,9 @@ func (ga *GenesisAlloc) flush(db ethdb.Database, triedb *trie.Database, blockhas
return err
}
for addr, account := range *ga {
statedb.AddBalance(addr, account.Balance)
if account.Balance != nil {
statedb.AddBalance(addr, account.Balance)
}
statedb.SetCode(addr, account.Code)
statedb.SetNonce(addr, account.Nonce)
for key, value := range account.Storage {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment