code: func (p *StateProcessor) Process(block *types.Block, statedb *state.StateDB, cfg vm.Config) (types.Receipts, []*types.Log, uint64, error) {
  	var (
  		receipts types.Receipts
  		usedGas  = new(uint64)
  		header   = block.Header()
  		allLogs  []*types.Log
  		gp       = new(GasPool).AddGas(block.GasLimit())
  	)
  	// Mutate the block and state according to any hard-fork specs
  	if p.config.DAOForkSupport && p.config.DAOForkBlock != nil && p.config.DAOForkBlock.Cmp(block.Number()) == 0 {
  		misc.ApplyDAOHardFork(statedb)
  	}
  	// Iterate over and process the individual transactions
  	for i, tx := range block.Transactions() {
  		statedb.Prepare(tx.Hash(), block.Hash(), i)
  		receipt, _, err := ApplyTransaction(p.config, p.bc, nil, gp, statedb, header, tx, usedGas, cfg)
  		if err != nil {
  			return nil, nil, 0, err
  		}
  		receipts = append(receipts, receipt)
  		allLogs = append(allLogs, receipt.Logs...)
  	}
  	// Finalize the block, applying any consensus engine specific extras (e.g. block rewards)
  	p.engine.Finalize(p.bc, header, statedb, block.Transactions(), block.Uncles())
  
  	return receipts, allLogs, *usedGas, nil
  }
docs: // Process processes the state changes according to the Ethereum rules by running
  // the transaction messages using the statedb and applying any rewards to both
  // the processor (coinbase) and any included uncles.
  //
  // Process returns the receipts and logs accumulated during the process and
  // returns the amount of gas that was used in the process. If any of the
  // transactions failed to execute due to insufficient gas it will return an error.