mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 02:42:27 +00:00
cmd/puppeth: fix panic error when export aleth genesis wo/ precompile-addresses
This commit is contained in:
parent
ddaf48bf84
commit
e92e68ee39
1 changed files with 5 additions and 1 deletions
|
|
@ -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
|
a := common.UnprefixedAddress(common.BytesToAddress([]byte{address}))
|
||||||
|
if _, exist := spec.Accounts[a]; !exist {
|
||||||
|
spec.Accounts[a] = &alethGenesisSpecAccount{}
|
||||||
|
}
|
||||||
|
spec.Accounts[a].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 a new issue