Skip to content

Commit

Permalink
MultiplexingDiscovery, DnsDiscovery: remove deprecated method and con…
Browse files Browse the repository at this point in the history
…structors that take NetworkParameters
  • Loading branch information
schildbach committed Sep 2, 2024
1 parent bc7883e commit 5992cf1
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 54 deletions.
25 changes: 0 additions & 25 deletions core/src/main/java/org/bitcoinj/net/discovery/DnsDiscovery.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,23 +67,6 @@ public DnsDiscovery(String[] dnsSeeds, Network network) {
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)
Expand All @@ -107,14 +90,6 @@ public DnsSeedDiscovery(Network network, String hostname) {
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -83,23 +81,6 @@ public static MultiplexingDiscovery forServices(Network network, long services,
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
Expand All @@ -109,19 +90,9 @@ public MultiplexingDiscovery(Network network, List<PeerDiscovery> seeds) {
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;
Expand Down

0 comments on commit 5992cf1

Please sign in to comment.