mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-17 09:23:48 +00:00
core: only do a local copy of the genesis block
This commit is contained in:
parent
bae8a52e8f
commit
3fa1ed8420
1 changed files with 6 additions and 14 deletions
|
|
@ -281,9 +281,14 @@ 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) {
|
func SetupGenesisBlockWithOverride(db ethdb.Database, triedb *triedb.Database, origGenesis *Genesis, overrides *ChainOverrides) (*params.ChainConfig, common.Hash, *params.ConfigCompatError, error) {
|
||||||
|
// Copy the genesis, so we can operate on a copy.
|
||||||
|
var genesis *Genesis
|
||||||
|
if origGenesis != nil {
|
||||||
|
genesis = new(Genesis)
|
||||||
|
*genesis = *origGenesis
|
||||||
|
}
|
||||||
// Sanitize the supplied genesis, ensuring it has the associated chain
|
// Sanitize the supplied genesis, ensuring it has the associated chain
|
||||||
// config attached.
|
// config attached.
|
||||||
genesis := origGenesis.copy()
|
|
||||||
if genesis != nil && genesis.Config == nil {
|
if genesis != nil && genesis.Config == nil {
|
||||||
return nil, common.Hash{}, nil, errGenesisNoConfig
|
return nil, common.Hash{}, nil, errGenesisNoConfig
|
||||||
}
|
}
|
||||||
|
|
@ -551,19 +556,6 @@ func (g *Genesis) MustCommit(db ethdb.Database, triedb *triedb.Database) *types.
|
||||||
return block
|
return block
|
||||||
}
|
}
|
||||||
|
|
||||||
// copy copies the genesis.
|
|
||||||
func (g *Genesis) copy() *Genesis {
|
|
||||||
if g != nil {
|
|
||||||
cpy := *g
|
|
||||||
if g.Config != nil {
|
|
||||||
conf := *g.Config
|
|
||||||
cpy.Config = &conf
|
|
||||||
}
|
|
||||||
return &cpy
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// EnableVerkleAtGenesis indicates whether the verkle fork should be activated
|
// EnableVerkleAtGenesis indicates whether the verkle fork should be activated
|
||||||
// at genesis. This is a temporary solution only for verkle devnet testing, where
|
// at genesis. This is a temporary solution only for verkle devnet testing, where
|
||||||
// verkle fork is activated at genesis, and the configured activation date has
|
// verkle fork is activated at genesis, and the configured activation date has
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue