Skip to content

Commit

Permalink
core: fix check at wrong place
Browse files Browse the repository at this point in the history
  • Loading branch information
holiman committed Aug 27, 2021
1 parent a854da8 commit 2e450bb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/blockchain.go
Expand Up @@ -1425,9 +1425,6 @@ func (bc *BlockChain) writeBlockWithoutState(block *types.Block, td *big.Int) (e
// writeKnownBlock updates the head block flag with a known block
// and introduces chain reorg if necessary.
func (bc *BlockChain) writeKnownBlock(block *types.Block) error {
if bc.insertStopped() {
return errInsertionInterrupted
}
bc.wg.Add(1)
defer bc.wg.Done()

Expand All @@ -1452,6 +1449,9 @@ func (bc *BlockChain) WriteBlockWithState(block *types.Block, receipts []*types.
// writeBlockWithState writes the block and all associated state to the database,
// but is expects the chain mutex to be held.
func (bc *BlockChain) writeBlockWithState(block *types.Block, receipts []*types.Receipt, logs []*types.Log, state *state.StateDB, emitHeadEvent bool) (status WriteStatus, err error) {
if bc.insertStopped() {
return NonStatTy, errInsertionInterrupted
}
bc.wg.Add(1)
defer bc.wg.Done()

Expand Down

0 comments on commit 2e450bb

Please sign in to comment.