code: func (ef *FeeEstimator) EstimateFee(numBlocks uint32) (BtcPerKilobyte, error) {
  	ef.mtx.Lock()
  	defer ef.mtx.Unlock()
  
  	// If the number of registered blocks is below the minimum, return
  	// an error.
  	if ef.numBlocksRegistered < ef.minRegisteredBlocks {
  		return -1, errors.New("not enough blocks have been observed")
  	}
  
  	if numBlocks == 0 {
  		return -1, errors.New("cannot confirm transaction in zero blocks")
  	}
  
  	if numBlocks > estimateFeeDepth {
  		return -1, fmt.Errorf(
  			"can only estimate fees for up to %d blocks from now",
  			estimateFeeBinSize)
  	}
  
  	// If there are no cached results, generate them.
  	if ef.cached == nil {
  		ef.cached = ef.estimates()
  	}
  
  	return ef.cached[int(numBlocks)-1].ToBtcPerKb(), nil
  }
docs: // EstimateFee estimates the fee per byte to have a tx confirmed a given
  // number of blocks from now.