From 1e6dcb35ab0addae17fbd5ad83a5f7134dea1e14 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Fri, 8 Sep 2017 19:25:42 +0200 Subject: [PATCH] core: fix DB write error handling --- core/blockchain.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/blockchain.go b/core/blockchain.go index bcf7c9af7d..63266a3419 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -807,12 +807,12 @@ func (bc *BlockChain) WriteBlockAndState(block *types.Block, receipts []*types.R // Irrelevant of the canonical status, write the block itself to the database if err := bc.hc.WriteTd(block.Hash(), block.NumberU64(), externTd); err != nil { - log.Crit("Failed to write block total difficulty", "err", err) + return NonStatTy, err } // Write other block data using a batch. batch := bc.chainDb.NewBatch() if err := WriteBlock(batch, block); err != nil { - log.Crit("Failed to write block contents", "err", err) + return NonStatTy, err } if _, err := state.CommitTo(batch, bc.config.IsEIP158(block.Number())); err != nil { return NonStatTy, err