Skip to content

Commit

Permalink
cmd/puppeth: fix panic error when export aleth genesis wo/ precompile…
Browse files Browse the repository at this point in the history
…-addresses (#18344)

* cmd/puppeth: fix panic error when export aleth genesis wo/ precompile-addresses

* cmd/puppeth: don't need to handle duplicate set
  • Loading branch information
hadv authored and karalabe committed Jan 4, 2019
1 parent 4997526 commit 3f421ac
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/puppeth/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,11 @@ func (spec *alethGenesisSpec) setPrecompile(address byte, data *alethGenesisSpec
if spec.Accounts == nil {
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) {
Expand Down

0 comments on commit 3f421ac

Please sign in to comment.