com.google.bitcoin.core
Class SeedPeers
java.lang.Object
com.google.bitcoin.core.SeedPeers
- All Implemented Interfaces:
- PeerDiscovery
public class SeedPeers
- extends Object
- implements PeerDiscovery
SeedPeers stores a pre-determined list of Bitcoin node addresses. These nodes are selected based on being
active on the network for a long period of time. The intention is to be a last resort way of finding a connection
to the network, in case IRC and DNS fail. The list comes from the Bitcoin C++ source code.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SeedPeers
public SeedPeers(NetworkParameters params)
getPeer
public InetSocketAddress getPeer()
throws PeerDiscoveryException
- Acts as an iterator, returning the address of each node in the list sequentially.
Once all the list has been iterated, null will be returned for each subsequent query.
- Returns:
- InetSocketAddress - The address/port of the next node.
- Throws:
PeerDiscoveryException
getPeers
public InetSocketAddress[] getPeers()
throws PeerDiscoveryException
- Returns an array containing all the Bitcoin nodes within the list.
- Specified by:
getPeers
in interface PeerDiscovery
- Throws:
PeerDiscoveryException
Copyright © 2011. All Rights Reserved.