core: copy CliqueConfig in DeveloperGenesisBlock (#23068)

Copy the CliqueConfig instead of reusing the pointer.
This makes DeveloperGenesisBlock thread safe and prevents it from
changing params.AllCliqueProtocolChanges.Clique.Epoch.
pull/23074/head
Oliver Tale-Yazdi 3 years ago committed by GitHub
parent 4695117f2e
commit 7b6c8363da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      core/genesis.go

@ -415,7 +415,10 @@ func DefaultCalaverasGenesisBlock() *Genesis {
func DeveloperGenesisBlock(period uint64, faucet common.Address) *Genesis {
// Override the default period to the user requested one
config := *params.AllCliqueProtocolChanges
config.Clique.Period = period
config.Clique = &params.CliqueConfig{
Period: period,
Epoch: config.Clique.Epoch,
}
// Assemble and return the genesis with the precompiles and faucet pre-funded
return &Genesis{

Loading…
Cancel
Save