From eb6b3db0b4157889e29e97f89129c341cf1f3d27 Mon Sep 17 00:00:00 2001 From: Martin Holst Swende Date: Fri, 29 Mar 2019 11:53:40 +0100 Subject: [PATCH] core: initialize current block/fastblock atomics to nil, fix #19286 --- core/blockchain.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/blockchain.go b/core/blockchain.go index 745f67d8c0a2..e6f7966ea3c0 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -201,6 +201,10 @@ 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) + if err := bc.loadLastState(); err != nil { return nil, err }