Rename variable peers to peerGroup, as the name can be misleading.

This commit is contained in:
Andreas Schildbach
2017-12-21 12:46:12 +01:00
parent e036f8174a
commit c927f0238b
2 changed files with 36 additions and 36 deletions

View File

@@ -61,12 +61,12 @@ public class RestoreFromSeed {
// Setting up the BlochChain, the BlocksStore and connecting to the network.
SPVBlockStore chainStore = new SPVBlockStore(params, chainFile);
BlockChain chain = new BlockChain(params, chainStore);
PeerGroup peers = new PeerGroup(params, chain);
peers.addPeerDiscovery(new DnsDiscovery(params));
PeerGroup peerGroup = new PeerGroup(params, chain);
peerGroup.addPeerDiscovery(new DnsDiscovery(params));
// Now we need to hook the wallet up to the blockchain and the peers. This registers event listeners that notify our wallet about new transactions.
chain.addWallet(wallet);
peers.addWallet(wallet);
peerGroup.addWallet(wallet);
DownloadProgressTracker bListener = new DownloadProgressTracker() {
@Override
@@ -76,8 +76,8 @@ public class RestoreFromSeed {
};
// Now we re-download the blockchain. This replays the chain into the wallet. Once this is completed our wallet should know of all its transactions and print the correct balance.
peers.start();
peers.startBlockChainDownload(bListener);
peerGroup.start();
peerGroup.startBlockChainDownload(bListener);
bListener.await();
@@ -85,6 +85,6 @@ public class RestoreFromSeed {
System.out.println(wallet.toString());
// shutting down again
peers.stop();
peerGroup.stop();
}
}