Skip to content

Commit

Permalink
Call OnBlockchainInit before OnGenesisBlock (ethereum#22)
Browse files Browse the repository at this point in the history
# Conflicts:
#	core/blockchain.go
  • Loading branch information
maoueh committed Mar 14, 2024
1 parent 77a701c commit 1770744
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,10 @@ func NewBlockChain(db ethdb.Database, cacheConfig *CacheConfig, genesis *Genesis
}
}

if bc.logger != nil && bc.logger.OnBlockchainInit != nil {
bc.logger.OnBlockchainInit(chainConfig)
}

if bc.logger != nil && bc.logger.OnGenesisBlock != nil {
if block := bc.CurrentBlock(); block.Number.Uint64() == 0 {
alloc, err := getGenesisState(bc.db, block.Hash())
Expand Down Expand Up @@ -488,10 +492,8 @@ func NewBlockChain(db ethdb.Database, cacheConfig *CacheConfig, genesis *Genesis
}
rawdb.WriteChainConfig(db, genesisHash, chainConfig)
}
if bc.logger != nil && bc.logger.OnBlockchainInit != nil {
bc.logger.OnBlockchainInit(chainConfig)
}
// Start tx indexer/unindexer if required.

// Start tx indexer if it's enabled.
if txLookupLimit != nil {
bc.txLookupLimit = *txLookupLimit

Expand Down

0 comments on commit 1770744

Please sign in to comment.