Package org.bitcoinj.net.discovery
Interface PeerDiscovery
- All Known Implementing Classes:
DnsDiscovery
,DnsDiscovery.DnsSeedDiscovery
,MultiplexingDiscovery
,SeedPeers
public interface PeerDiscovery
A PeerDiscovery object is responsible for finding addresses of other nodes in the Bitcoin P2P network. Note that
the addresses returned may or may not be accepting connections.
-
Method Summary
Modifier and TypeMethodDescriptiondefault List<InetSocketAddress>
Deprecated.Queries for addresses.void
shutdown()
Stops any discovery in progress when we want to shut down quickly.
-
Method Details
-
getPeers
Queries for addresses. This method may block.- Parameters:
services
- required services as a bitmask, e.g.Services.NODE_NETWORK
timeout
- query timeout- Returns:
- found addresses
- Throws:
PeerDiscoveryException
-
getPeers
@Deprecated default List<InetSocketAddress> getPeers(long services, long timeoutValue, TimeUnit timeoutUnit) throws PeerDiscoveryException Deprecated.- Throws:
PeerDiscoveryException
-
shutdown
void shutdown()Stops any discovery in progress when we want to shut down quickly.
-
getPeers(long, Duration)