Skip to content
This repository has been archived by the owner on May 21, 2024. It is now read-only.

Commit

Permalink
core: initialize current block/fastblock atomics to nil, fix ethereum…
Browse files Browse the repository at this point in the history
  • Loading branch information
holiman authored and elizabethengelman committed Dec 20, 2019
1 parent 6fd8d65 commit 660a9f6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,16 @@ func NewBlockChain(db ethdb.Database, cacheConfig *CacheConfig, chainConfig *par
if bc.genesisBlock == nil {
return nil, ErrNoGenesis
}

var nilBlock *types.Block
bc.currentBlock.Store(nilBlock)
bc.currentFastBlock.Store(nilBlock)

// Initialize the chain with ancient data if it isn't empty.
if bc.empty() {
rawdb.InitDatabaseFromFreezer(bc.db)
}

if err := bc.loadLastState(); err != nil {
return nil, err
}
Expand Down

0 comments on commit 660a9f6

Please sign in to comment.