From 3b77e0ff4bcce8c0c9f18f23625a6fe69d17bbed Mon Sep 17 00:00:00 2001 From: rjl493456442 Date: Thu, 28 Mar 2024 19:06:57 +0800 Subject: [PATCH] core: remove unused code (#29381) --- core/blockchain.go | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/core/blockchain.go b/core/blockchain.go index 70d0fed689..6808753734 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -1552,17 +1552,6 @@ func (bc *BlockChain) writeBlockWithState(block *types.Block, receipts []*types. return nil } -// WriteBlockAndSetHead writes the given block and all associated state to the database, -// and applies the block as the new chain head. -func (bc *BlockChain) WriteBlockAndSetHead(block *types.Block, receipts []*types.Receipt, logs []*types.Log, state *state.StateDB, emitHeadEvent bool) (status WriteStatus, err error) { - if !bc.chainmu.TryLock() { - return NonStatTy, errChainStopped - } - defer bc.chainmu.Unlock() - - return bc.writeBlockAndSetHead(block, receipts, logs, state, emitHeadEvent) -} - // writeBlockAndSetHead is the internal implementation of WriteBlockAndSetHead. // This function expects the chain mutex to be held. func (bc *BlockChain) writeBlockAndSetHead(block *types.Block, receipts []*types.Receipt, logs []*types.Log, state *state.StateDB, emitHeadEvent bool) (status WriteStatus, err error) {