Skip to content

Commit

Permalink
fix: nil pointer when deactivating verkle-incompatible genesis code (e…
Browse files Browse the repository at this point in the history
  • Loading branch information
gballet authored Jan 31, 2024
1 parent 0b0735a commit aa4c9c1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,8 @@ func SetupGenesisBlockWithOverride(db ethdb.Database, triedb *trie.Database, gen
// We have the genesis block in database(perhaps in ancient database)
// but the corresponding state is missing.
header := rawdb.ReadHeader(db, stored, 0)
if !genesis.Config.IsPrague(big.NewInt(0), genesis.Timestamp) && header.Root != types.EmptyRootHash && !rawdb.HasLegacyTrieNode(db, header.Root) {
notverkle := genesis == nil || genesis.Config == nil || genesis.Config.PragueTime == nil || !genesis.Config.IsPrague(big.NewInt(0), genesis.Timestamp)
if notverkle && header.Root != types.EmptyRootHash && !rawdb.HasLegacyTrieNode(db, header.Root) {
if genesis == nil {
genesis = DefaultGenesisBlock()
}
Expand Down

0 comments on commit aa4c9c1

Please sign in to comment.