@@ -172,21 +172,21 @@ var (
172172// It verifies that the genesis is compatible with any previously setup genesis
173173// state by checking the genesis block hash along with the rules used to execute
174174// the head block.
175- func (g * genesis ) setup (db ethdb.Database , trieConfig * triedb.Config ) (_ * types. Block , retErr error ) {
175+ func (g * genesis ) setup (db ethdb.Database , trieConfig * triedb.Config ) (retErr error ) {
176176 block , err := g .block ()
177177 if err != nil {
178- return nil , fmt .Errorf ("constructing genesis block: %w" , err )
178+ return fmt .Errorf ("constructing genesis block: %w" , err )
179179 }
180180
181181 // We can't exit early here. Even if the genesis block is on disk, the
182182 // genesis state might not be.
183183 hash := block .Hash ()
184184 if prev := rawdb .ReadCanonicalHash (db , genesisNumber ); prev == (common.Hash {}) {
185185 if err := writeGenesisBlock (db , block , g .Config ); err != nil {
186- return nil , fmt .Errorf ("writing block: %w" , err )
186+ return fmt .Errorf ("writing block: %w" , err )
187187 }
188188 } else if prev != hash {
189- return nil , & core.GenesisMismatchError {
189+ return & core.GenesisMismatchError {
190190 Stored : prev ,
191191 New : hash ,
192192 }
@@ -197,18 +197,18 @@ func (g *genesis) setup(db ethdb.Database, trieConfig *triedb.Config) (_ *types.
197197 {
198198 prev := rawdb .ReadChainConfig (db , hash )
199199 if prev == nil {
200- return nil , errNoStoredChainConfig
200+ return errNoStoredChainConfig
201201 }
202202 head := rawdb .ReadHeadHeader (db )
203203 if head == nil {
204- return nil , errNoHeadHeader
204+ return errNoHeadHeader
205205 }
206206 height , timestamp := head .Number .Uint64 (), head .Time
207207 // TODO(JonathanOppenheimer): coreth exposes a `skip-upgrade-check` config
208208 // that bypasses this compatibility check; we need to make such a check
209209 // unnecessary for the c-chain.
210210 if err := prev .CheckCompatible (g .Config , height , timestamp ); err != nil {
211- return nil , fmt .Errorf ("incompatible chain config: %w" , err )
211+ return fmt .Errorf ("incompatible chain config: %w" , err )
212212 }
213213 // We will be executing new blocks based on the new chain config, so we
214214 // need to keep it up-to-date in the database for the next restart.
@@ -224,10 +224,10 @@ func (g *genesis) setup(db ethdb.Database, trieConfig *triedb.Config) (_ *types.
224224 // the trie to determine if the genesis was previously initialized.
225225 if ! tdb .Initialized (block .Root ()) {
226226 if _ , err := g .writeState (db , tdb ); err != nil {
227- return nil , fmt .Errorf ("writing genesis state: %w" , err )
227+ return fmt .Errorf ("writing genesis state: %w" , err )
228228 }
229229 }
230- return block , nil
230+ return nil
231231}
232232
233233func writeGenesisBlock (db ethdb.Database , block * types.Block , config * ethparams.ChainConfig ) error {
0 commit comments