code: func (bc *BlockChain) WriteBlockWithState(block *types.Block, receipts []*types.Receipt, state *state.StateDB) (status WriteStatus, err error) {
  	bc.chainmu.Lock()
  	defer bc.chainmu.Unlock()
  
  	return bc.writeBlockWithState(block, receipts, state)
  }
docs: // WriteBlockWithState writes the block and all associated state to the database.