code: func (l *txList) Filter(costLimit *big.Int, gasLimit uint64) (types.Transactions, types.Transactions) {
  	// If all transactions are below the threshold, short circuit
  	if l.costcap.Cmp(costLimit) <= 0 && l.gascap <= gasLimit {
  		return nil, nil
  	}
  	l.costcap = new(big.Int).Set(costLimit) // Lower the caps to the thresholds
  	l.gascap = gasLimit
  
  	// Filter out all the transactions above the account's funds
  	removed := l.txs.Filter(func(tx *types.Transaction) bool { return tx.Cost().Cmp(costLimit) > 0 || tx.Gas() > gasLimit })
  
  	// If the list was strict, filter anything above the lowest nonce
  	var invalids types.Transactions
  
  	if l.strict && len(removed) > 0 {
  		lowest := uint64(math.MaxUint64)
  		for _, tx := range removed {
  			if nonce := tx.Nonce(); lowest > nonce {
  				lowest = nonce
  			}
  		}
  		invalids = l.txs.Filter(func(tx *types.Transaction) bool { return tx.Nonce() > lowest })
  	}
  	return removed, invalids
  }
docs: // Filter removes all transactions from the list with a cost or gas limit higher
  // than the provided thresholds. Every removed transaction is returned for any
  // post-removal maintenance. Strict-mode invalidated transactions are also
  // returned.
  //
  // This method uses the cached costcap and gascap to quickly decide if there's even
  // a point in calculating all the costs or if the balance covers all. If the threshold
  // is lower than the costgas cap, the caps will be reset to a new high after removing
  // the newly invalidated transactions.