public static MultiplexingDiscovery forServices(NetworkParameters params,long services){
  List<PeerDiscovery> discoveries=Lists.newArrayList();
  HttpDiscovery.Details[] httpSeeds=params.getHttpSeeds();
  if (httpSeeds != null) {
    OkHttpClient httpClient=new OkHttpClient();
    for (    HttpDiscovery.Details httpSeed : httpSeeds)     discoveries.add(new HttpDiscovery(params,httpSeed,httpClient));
  }
  if (services == 0) {
    String[] dnsSeeds=params.getDnsSeeds();
    if (dnsSeeds != null)     for (    String dnsSeed : dnsSeeds)     discoveries.add(new DnsSeedDiscovery(params,dnsSeed));
  }
  return new MultiplexingDiscovery(params,discoveries);
}

public static MultiplexingDiscovery forServices ( NetworkParameters params , long services ) { List < PeerDiscovery > discoveries = Lists . newArrayList ( ) ; HttpDiscovery . Details [ ] httpSeeds = params . getHttpSeeds ( ) ; if ( httpSeeds != null ) { OkHttpClient httpClient = new OkHttpClient ( ) ; for ( HttpDiscovery . Details httpSeed : httpSeeds ) discoveries . add ( new HttpDiscovery ( params , httpSeed , httpClient ) ) ; } if ( services == 0 ) { String [ ] dnsSeeds = params . getDnsSeeds ( ) ; if ( dnsSeeds != null ) for ( String dnsSeed : dnsSeeds ) discoveries . add ( new DnsSeedDiscovery ( params , dnsSeed ) ) ; } return new MultiplexingDiscovery ( params , discoveries ) ; }
builds a suitable set of peer discoveries . will query them in parallel before producing a merged response . if specific services are required , dns is not used as the protocol can ' t handle it .
