public class SeedPeers extends 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 |
---|---|
InetSocketAddress |
getPeer()
Acts as an iterator, returning the address of each node in the list sequentially.
|
InetSocketAddress[] |
getPeers(long services,
long timeoutValue,
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 InetSocketAddress getPeer() throws PeerDiscoveryException
PeerDiscoveryException
public InetSocketAddress[] getPeers(long services, long timeoutValue, 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
Copyright © 2016. All rights reserved.