code: func NewBlkTmplGenerator(policy *Policy, params *chaincfg.Params,
  	txSource TxSource, chain *blockchain.BlockChain,
  	timeSource blockchain.MedianTimeSource,
  	sigCache *txscript.SigCache,
  	hashCache *txscript.HashCache) *BlkTmplGenerator {
  
  	return &BlkTmplGenerator{
  		policy:      policy,
  		chainParams: params,
  		txSource:    txSource,
  		chain:       chain,
  		timeSource:  timeSource,
  		sigCache:    sigCache,
  		hashCache:   hashCache,
  	}
  }
docs: // NewBlkTmplGenerator returns a new block template generator for the given
  // policy using transactions from the provided transaction source.
  //
  // The additional state-related fields are required in order to ensure the
  // templates are built on top of the current best chain and adhere to the
  // consensus rules.