MultiplexingDiscovery, DnsDiscovery: remove deprecated method and constructors that take NetworkParameters

This commit is contained in:
Andreas Schildbach 2024-09-02 20:42:27 +02:00
parent 5be38aeca1
commit 96c60b65b6
2 changed files with 0 additions and 54 deletions

View File

@ -67,23 +67,6 @@ public class DnsDiscovery extends MultiplexingDiscovery {
super(network, buildDiscoveries(network, dnsSeeds));
}
/**
* @deprecated Use {@link DnsDiscovery#DnsDiscovery(Network)}
*/
@Deprecated
public DnsDiscovery(NetworkParameters netParams) {
this(netParams.getDnsSeeds(), netParams.network());
}
/**
* @deprecated Use {@link DnsDiscovery#DnsDiscovery(String[], Network)}
*/
@Deprecated
public DnsDiscovery(String[] dnsSeeds, NetworkParameters params) {
this(dnsSeeds, params.network());
}
private static List<PeerDiscovery> buildDiscoveries(Network network, String[] seeds) {
List<PeerDiscovery> discoveries = new ArrayList<>();
if (seeds != null)
@ -107,14 +90,6 @@ public class DnsDiscovery extends MultiplexingDiscovery {
this.params = NetworkParameters.of(network);
}
/**
* @deprecated Use {@link DnsSeedDiscovery#DnsSeedDiscovery(Network, String)}
*/
@Deprecated
public DnsSeedDiscovery(NetworkParameters params, String hostname) {
this(params.network(), hostname);
}
@Override
public List<InetSocketAddress> getPeers(long services, Duration timeout) throws PeerDiscoveryException {
InetAddress[] response = null;

View File

@ -51,8 +51,6 @@ public class MultiplexingDiscovery implements PeerDiscovery {
private static final Logger log = LoggerFactory.getLogger(MultiplexingDiscovery.class);
protected final List<PeerDiscovery> seeds;
@Deprecated
protected final NetworkParameters netParams;
private volatile ExecutorService vThreadPool;
private final boolean parallelQueries;
private final boolean shufflePeers;
@ -83,23 +81,6 @@ public class MultiplexingDiscovery implements PeerDiscovery {
return new MultiplexingDiscovery(network, discoveries, parallelQueries, shufflePeers);
}
/**
* @deprecated Use {@link #forServices(Network, long)}
*/
@Deprecated
public static MultiplexingDiscovery forServices(NetworkParameters params, long services) {
return forServices(params.network(), services);
}
/**
* @deprecated Use {@link #forServices(Network, long, boolean, boolean)}
*/
@Deprecated
public static MultiplexingDiscovery forServices(NetworkParameters params, long services, boolean parallelQueries,
boolean shufflePeers) {
return forServices(params.network(), services, parallelQueries, shufflePeers);
}
/**
* Will query the given seeds in parallel before producing a merged response.
* @param network The network we are querying for
@ -109,19 +90,9 @@ public class MultiplexingDiscovery implements PeerDiscovery {
this(network, seeds, true, true);
}
/**
* Will query the given seeds in parallel before producing a merged response.
* @deprecated Use {@link MultiplexingDiscovery#MultiplexingDiscovery(Network, List)}
*/
@Deprecated
public MultiplexingDiscovery(NetworkParameters params, List<PeerDiscovery> seeds) {
this(params.network(), seeds);
}
private MultiplexingDiscovery(Network network, List<PeerDiscovery> seeds, boolean parallelQueries,
boolean shufflePeers) {
checkArgument(!seeds.isEmpty() || network == REGTEST);
this.netParams = NetworkParameters.of(network);
this.seeds = seeds;
this.parallelQueries = parallelQueries;
this.shufflePeers = shufflePeers;