public class SeedPeers extends java.lang.Object implements PeerDiscovery
Constructor and Description |
---|
SeedPeers(int[] seedAddrs,
NetworkParameters params)
Supports finding peers by IP addresses
|
SeedPeers(NetworkParameters params)
Supports finding peers by IP addresses
|
Modifier and Type | Method and Description |
---|---|
java.net.InetSocketAddress |
getPeer()
Acts as an iterator, returning the address of each node in the list sequentially.
|
java.net.InetSocketAddress[] |
getPeers(long services,
long timeoutValue,
java.util.concurrent.TimeUnit timeoutUnit)
Returns an array containing all the Bitcoin nodes within the list.
|
void |
shutdown()
Stops any discovery in progress when we want to shut down quickly.
|
public SeedPeers(NetworkParameters params)
params
- Network parameters to be used for port information.public SeedPeers(int[] seedAddrs, NetworkParameters params)
seedAddrs
- IP addresses for seed addresses.params
- Network parameters to be used for port information.@Nullable public java.net.InetSocketAddress getPeer() throws PeerDiscoveryException
PeerDiscoveryException
public java.net.InetSocketAddress[] getPeers(long services, long timeoutValue, java.util.concurrent.TimeUnit timeoutUnit) throws PeerDiscoveryException
getPeers
in interface PeerDiscovery
services
- Required services as a bitmask, e.g. VersionMessage.NODE_NETWORK
.PeerDiscoveryException
public void shutdown()
PeerDiscovery
shutdown
in interface PeerDiscovery