mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-16 04:56:36 +00:00
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.
This commit is contained in:
parent
4695117f2e
commit
7b6c8363da
1 changed files with 4 additions and 1 deletions
|
|
@ -415,7 +415,10 @@ func DefaultCalaverasGenesisBlock() *Genesis {
|
||||||
func DeveloperGenesisBlock(period uint64, faucet common.Address) *Genesis {
|
func DeveloperGenesisBlock(period uint64, faucet common.Address) *Genesis {
|
||||||
// Override the default period to the user requested one
|
// Override the default period to the user requested one
|
||||||
config := *params.AllCliqueProtocolChanges
|
config := *params.AllCliqueProtocolChanges
|
||||||
config.Clique.Period = period
|
config.Clique = ¶ms.CliqueConfig{
|
||||||
|
Period: period,
|
||||||
|
Epoch: config.Clique.Epoch,
|
||||||
|
}
|
||||||
|
|
||||||
// Assemble and return the genesis with the precompiles and faucet pre-funded
|
// Assemble and return the genesis with the precompiles and faucet pre-funded
|
||||||
return &Genesis{
|
return &Genesis{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue