From e4cf34fe260a67a0997d984cc15501fafc86e0b2 Mon Sep 17 00:00:00 2001 From: elizabeth Date: Mon, 16 Oct 2023 15:06:59 -0400 Subject: [PATCH] set genesis block as head/safe/final --- core/blockchain.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/blockchain.go b/core/blockchain.go index 8fc520e776..99c80e0f8c 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -289,10 +289,10 @@ func NewBlockChain(db ethdb.Database, cacheConfig *CacheConfig, genesis *Genesis return nil, ErrNoGenesis } - bc.currentBlock.Store(nil) - bc.currentSnapBlock.Store(nil) - bc.currentFinalBlock.Store(nil) - bc.currentSafeBlock.Store(nil) + bc.currentBlock.Store(bc.genesisBlock.Header()) + bc.currentSnapBlock.Store(bc.genesisBlock.Header()) + bc.currentFinalBlock.Store(bc.genesisBlock.Header()) + bc.currentSafeBlock.Store(bc.genesisBlock.Header()) // If Geth is initialized with an external ancient store, re-initialize the // missing chain indexes and chain flags. This procedure can survive crash