Skip to content

Commit

Permalink
Merge pull request #2095 from cheng762/feature/bump-version-to-1.4.1
Browse files Browse the repository at this point in the history
when update chainconfig,write it to db
  • Loading branch information
benbaley committed Jul 6, 2023
2 parents d77eaf7 + 02bd486 commit fd2b22c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions eth/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) {
}
}

chainConfig, _, genesisErr := core.SetupGenesisBlock(chainDb, snapshotBaseDB, config.Genesis)
chainConfig, genesisHash, genesisErr := core.SetupGenesisBlock(chainDb, snapshotBaseDB, config.Genesis)

if _, ok := genesisErr.(*params.ConfigCompatError); genesisErr != nil && !ok {
return nil, genesisErr
Expand Down Expand Up @@ -300,10 +300,10 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) {

// Rewind the chain in case of an incompatible config upgrade.
if compat, ok := genesisErr.(*params.ConfigCompatError); ok {
log.Warn("Rewinding chain to upgrade configuration", "err", compat)
return nil, compat
log.Warn("upgrade configuration", "err", compat)
//return nil, compat
//eth.blockchain.SetHead(compat.RewindTo)
//rawdb.WriteChainConfig(chainDb, genesisHash, chainConfig)
rawdb.WriteChainConfig(chainDb, genesisHash, chainConfig)
}
eth.bloomIndexer.Start(eth.blockchain)

Expand Down

0 comments on commit fd2b22c

Please sign in to comment.