mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-17 01:13:45 +00:00
core: fix DB write error handling
This commit is contained in:
parent
d61e09433a
commit
1e6dcb35ab
1 changed files with 2 additions and 2 deletions
|
|
@ -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
|
// Irrelevant of the canonical status, write the block itself to the database
|
||||||
if err := bc.hc.WriteTd(block.Hash(), block.NumberU64(), externTd); err != nil {
|
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.
|
// Write other block data using a batch.
|
||||||
batch := bc.chainDb.NewBatch()
|
batch := bc.chainDb.NewBatch()
|
||||||
if err := WriteBlock(batch, block); err != nil {
|
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 {
|
if _, err := state.CommitTo(batch, bc.config.IsEIP158(block.Number())); err != nil {
|
||||||
return NonStatTy, err
|
return NonStatTy, err
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue