mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-25 13:07:17 +00:00
cmd/puppeth: fix panic error when export aleth genesis wo/ precompile-addresses (#18344)
* cmd/puppeth: fix panic error when export aleth genesis wo/ precompile-addresses * cmd/puppeth: don't need to handle duplicate set
This commit is contained in:
parent
49975264a8
commit
3f421aca54
@ -174,7 +174,11 @@ func (spec *alethGenesisSpec) setPrecompile(address byte, data *alethGenesisSpec
|
|||||||
if spec.Accounts == nil {
|
if spec.Accounts == nil {
|
||||||
spec.Accounts = make(map[common.UnprefixedAddress]*alethGenesisSpecAccount)
|
spec.Accounts = make(map[common.UnprefixedAddress]*alethGenesisSpecAccount)
|
||||||
}
|
}
|
||||||
spec.Accounts[common.UnprefixedAddress(common.BytesToAddress([]byte{address}))].Precompiled = data
|
addr := common.UnprefixedAddress(common.BytesToAddress([]byte{address}))
|
||||||
|
if _, exist := spec.Accounts[addr]; !exist {
|
||||||
|
spec.Accounts[addr] = &alethGenesisSpecAccount{}
|
||||||
|
}
|
||||||
|
spec.Accounts[addr].Precompiled = data
|
||||||
}
|
}
|
||||||
|
|
||||||
func (spec *alethGenesisSpec) setAccount(address common.Address, account core.GenesisAccount) {
|
func (spec *alethGenesisSpec) setAccount(address common.Address, account core.GenesisAccount) {
|
||||||
|
Loading…
Reference in New Issue
Block a user