Skip to content

Commit

Permalink
core: handle VerifyHeader error at NewBlockChain fn
Browse files Browse the repository at this point in the history
Signed-off-by: meows <[email protected]>
  • Loading branch information
meowsbits committed Mar 19, 2020
1 parent 01bd708 commit 5b23e88
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,9 @@ func NewBlockChain(db ethdb.Database, cacheConfig *CacheConfig, chainConfig ctyp
// The first thing the node will do is reconstruct the verification data for
// the head block (ethash cache or clique voting snapshot). Might as well do
// it in advance.
bc.engine.VerifyHeader(bc, bc.CurrentHeader(), true)
if err := bc.engine.VerifyHeader(bc, bc.CurrentHeader(), true); err != nil {
return nil, err
}

if frozen, err := bc.db.Ancients(); err == nil && frozen > 0 {
var (
Expand Down

0 comments on commit 5b23e88

Please sign in to comment.