mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-11-03 05:57:21 +00:00
PeerAddress: Require NetworkParameters in constructors.
This commit is contained in:
@@ -39,7 +39,7 @@ public class FetchBlock {
|
||||
BlockChain chain = new BlockChain(params, blockStore);
|
||||
PeerGroup peerGroup = new PeerGroup(params, chain);
|
||||
peerGroup.start();
|
||||
PeerAddress addr = new PeerAddress(InetAddress.getLocalHost(), params.getPort());
|
||||
PeerAddress addr = new PeerAddress(params, InetAddress.getLocalHost());
|
||||
peerGroup.addAddress(addr);
|
||||
peerGroup.waitForPeers(1).get();
|
||||
Peer peer = peerGroup.getConnectedPeers().get(0);
|
||||
|
||||
@@ -40,7 +40,7 @@ public class FetchTransactions {
|
||||
BlockChain chain = new BlockChain(params, blockStore);
|
||||
PeerGroup peerGroup = new PeerGroup(params, chain);
|
||||
peerGroup.start();
|
||||
peerGroup.addAddress(new PeerAddress(InetAddress.getLocalHost(), params.getPort()));
|
||||
peerGroup.addAddress(new PeerAddress(params, InetAddress.getLocalHost()));
|
||||
peerGroup.waitForPeers(1).get();
|
||||
Peer peer = peerGroup.getConnectedPeers().get(0);
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ public class PrintPeers {
|
||||
NioClientManager clientManager = new NioClientManager();
|
||||
for (final InetAddress addr : addrs) {
|
||||
InetSocketAddress address = new InetSocketAddress(addr, params.getPort());
|
||||
final Peer peer = new Peer(params, new VersionMessage(params, 0), null, new PeerAddress(address));
|
||||
final Peer peer = new Peer(params, new VersionMessage(params, 0), null, new PeerAddress(params, address));
|
||||
final SettableFuture<Void> future = SettableFuture.create();
|
||||
// Once the connection has completed version handshaking ...
|
||||
peer.addConnectedEventListener(new PeerConnectedEventListener() {
|
||||
|
||||
@@ -63,7 +63,7 @@ public class PrivateKeys {
|
||||
BlockChain chain = new BlockChain(params, wallet, blockStore);
|
||||
|
||||
final PeerGroup peerGroup = new PeerGroup(params, chain);
|
||||
peerGroup.addAddress(new PeerAddress(InetAddress.getLocalHost()));
|
||||
peerGroup.addAddress(new PeerAddress(params, InetAddress.getLocalHost()));
|
||||
peerGroup.startAsync();
|
||||
peerGroup.downloadBlockChain();
|
||||
peerGroup.stopAsync();
|
||||
|
||||
Reference in New Issue
Block a user