mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-03 02:23:48 +00:00
Call OnBlockchainInit before OnGenesisBlock (#22)
# Conflicts: # core/blockchain.go
This commit is contained in:
parent
77a701cca4
commit
177074432d
1 changed files with 6 additions and 4 deletions
|
|
@ -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())
|
||||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue