From 16b6c4c4e25d1dc712f75acd7313ae35c4fef1d8 Mon Sep 17 00:00:00 2001 From: Marius van der Wijden Date: Thu, 30 Jan 2025 16:44:14 +0100 Subject: [PATCH] core: copy genesis before modifying --- core/genesis.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/genesis.go b/core/genesis.go index 03c89d4534..ad59573fff 100644 --- a/core/genesis.go +++ b/core/genesis.go @@ -283,7 +283,7 @@ func SetupGenesisBlock(db ethdb.Database, triedb *triedb.Database, genesis *Gene func SetupGenesisBlockWithOverride(db ethdb.Database, triedb *triedb.Database, origGenesis *Genesis, overrides *ChainOverrides) (*params.ChainConfig, common.Hash, *params.ConfigCompatError, error) { // Sanitize the supplied genesis, ensuring it has the associated chain // config attached. - genesis := origGenesis.Copy() + genesis := origGenesis.copy() if genesis != nil && genesis.Config == nil { return nil, common.Hash{}, nil, errGenesisNoConfig } @@ -552,7 +552,7 @@ func (g *Genesis) MustCommit(db ethdb.Database, triedb *triedb.Database) *types. } // Copy copies the genesis. -func (g *Genesis) Copy() *Genesis { +func (g *Genesis) copy() *Genesis { if g != nil { cpy := *g if g.Config != nil {