code: func (r *PeerResolver) Filter(peers []fab.Peer) []fab.Peer {
  	var minBlockHeight uint64
  	if r.minBlockHeight > 0 {
  		lastBlockReceived := r.dispatcher.LastBlockNum()
  		if lastBlockReceived == math.MaxUint64 {
  			// No blocks received yet
  			logger.Debugf("Min block height was specified: %d", r.minBlockHeight)
  			minBlockHeight = r.minBlockHeight
  		} else {
  			// Make sure minBlockHeight is greater than the last block received
  			if r.minBlockHeight > lastBlockReceived {
  				minBlockHeight = r.minBlockHeight
  			} else {
  				minBlockHeight = lastBlockReceived + 1
  				logger.Debugf("Min block height was specified as %d but the last block received was %d. Setting min height to %d", r.minBlockHeight, lastBlockReceived, minBlockHeight)
  			}
  		}
  	}
  
  	retPeers := r.doFilterByBlockHeight(minBlockHeight, peers)
  	if len(retPeers) == 0 && minBlockHeight > 0 {
  		// The last block that was received may have been the last block in the channel. Try again with lastBlock-1.
  		logger.Debugf("No peers at the minimum height %d. Trying again with min height %d ...", minBlockHeight, minBlockHeight-1)
  		minBlockHeight--
  		retPeers = r.doFilterByBlockHeight(minBlockHeight, peers)
  		if len(retPeers) == 0 {
  			// No peers at the given height. Try again without min height
  			logger.Debugf("No peers at the minimum height %d. Trying again without min height ...", minBlockHeight)
  			retPeers = r.doFilterByBlockHeight(0, peers)
  		}
  	}
  
  	return retPeers
  }
docs: // Filter returns the peers that are within a provided "lag" threshold from the highest block height of all peers.