@@ -1803,27 +1803,6 @@ func (bc *BlockChain) insertChain(chain types.Blocks, verifySeals bool) (int, er
1803
1803
return it .index , err
1804
1804
}
1805
1805
1806
- // PreprocessBlock processes block on top of the chain to calculate receipts, bloom and state root
1807
- func (bc * BlockChain ) PreprocessBlock (block * types.Block ) (common.Hash , types.Bloom , common.Hash , uint64 , error ) {
1808
- // Retrieve the parent block and it's state to execute on top
1809
- parent := bc .CurrentBlock ().Header ()
1810
- if parent == nil {
1811
- parent = bc .GetHeader (block .ParentHash (), block .NumberU64 ()- 1 )
1812
- }
1813
- statedb , err := state .New (parent .Root , bc .stateCache , bc .snaps )
1814
- if err != nil {
1815
- return common.Hash {}, types.Bloom {}, common.Hash {}, 0 , err
1816
- }
1817
- receipts , _ , usedGas , err := bc .processor .Process (block , statedb , bc .vmConfig )
1818
- if err != nil {
1819
- return common.Hash {}, types.Bloom {}, common.Hash {}, 0 , err
1820
- }
1821
- receiptSha := types .DeriveSha (receipts , trie .NewStackTrie (nil ))
1822
- bloom := types .CreateBloom (receipts )
1823
- stateRoot := statedb .GetRootHash ()
1824
- return receiptSha , bloom , stateRoot , usedGas , nil
1825
- }
1826
-
1827
1806
func (bc * BlockChain ) BuildAndWriteBlock (parentBlock * types.Block , header * types.Header , txs types.Transactions ) (WriteStatus , error ) {
1828
1807
if ! bc .chainmu .TryLock () {
1829
1808
return NonStatTy , errInsertionInterrupted
0 commit comments