mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-26 14:46:42 +00:00
eth: fixed issue where genesis was not stored in the db
This commit is contained in:
parent
0ae7f0cc2b
commit
ab7a820512
1 changed files with 10 additions and 9 deletions
|
|
@ -66,7 +66,6 @@ import (
|
|||
"github.com/ethereum/go-ethereum/params"
|
||||
"github.com/ethereum/go-ethereum/rlp"
|
||||
"github.com/ethereum/go-ethereum/rpc"
|
||||
"github.com/ethereum/go-ethereum/triedb"
|
||||
gethversion "github.com/ethereum/go-ethereum/version"
|
||||
)
|
||||
|
||||
|
|
@ -191,21 +190,23 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) {
|
|||
overrides.OverrideVerkle = config.OverrideVerkle
|
||||
}
|
||||
|
||||
chainConfig, _, compatErr, err := core.SetupGenesisBlockWithOverride(chainDb, triedb.NewDatabase(chainDb, triedb.HashDefaults), config.Genesis, &overrides)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// chainConfig, genesisHash, compatErr, err := core.SetupGenesisBlockWithOverride(chainDb, triedb.NewDatabase(chainDb, triedb.HashDefaults), config.Genesis, &overrides)
|
||||
// if err != nil {
|
||||
// return nil, err
|
||||
// }
|
||||
|
||||
// rawdb.WriteChainConfig(chainDb, genesisHash, chainConfig)
|
||||
|
||||
blockChainAPI := ethapi.NewBlockChainAPI(eth.APIBackend)
|
||||
engine, err := ethconfig.CreateConsensusEngine(chainConfig, config, chainDb, blockChainAPI)
|
||||
engine, err := ethconfig.CreateConsensusEngine(config.Genesis.Config, config, chainDb, blockChainAPI)
|
||||
eth.engine = engine
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if compatErr != nil {
|
||||
return nil, compatErr
|
||||
}
|
||||
// if compatErr != nil {
|
||||
// return nil, compatErr
|
||||
// }
|
||||
// END: Bor changes
|
||||
|
||||
bcVersion := rawdb.ReadDatabaseVersion(chainDb)
|
||||
|
|
|
|||
Loading…
Reference in a new issue