/** * Download the blockchain from peers. Convenience that uses a {@link DownloadProgressTracker} for you.<p> * * This method waits until the download is complete. "Complete" is defined as downloading * from at least one peer all the blocks that are in that peer's inventory. */ public void downloadBlockChain() { DownloadProgressTracker listener = new DownloadProgressTracker(); startBlockChainDownload(listener); try { listener.await(); } catch (InterruptedException e) { throw new RuntimeException(e); } }
/** * Download the blockchain from peers. Convenience that uses a {@link DownloadProgressTracker} for you.<p> * * This method waits until the download is complete. "Complete" is defined as downloading * from at least one peer all the blocks that are in that peer's inventory. */ public void downloadBlockChain() { DownloadProgressTracker listener = new DownloadProgressTracker(); startBlockChainDownload(listener); try { listener.await(); } catch (InterruptedException e) { throw new RuntimeException(e); } }
/** * Download the blockchain from peers. Convenience that uses a {@link DownloadProgressTracker} for you.<p> * * This method waits until the download is complete. "Complete" is defined as downloading * from at least one peer all the blocks that are in that peer's inventory. */ public void downloadBlockChain() { DownloadProgressTracker listener = new DownloadProgressTracker(); startBlockChainDownload(listener); try { listener.await(); } catch (InterruptedException e) { throw new RuntimeException(e); } }
/** * Download the blockchain from peers. Convenience that uses a {@link DownloadProgressTracker} for you.<p> * * This method waits until the download is complete. "Complete" is defined as downloading * from at least one peer all the blocks that are in that peer's inventory. */ public void downloadBlockChain() { DownloadProgressTracker listener = new DownloadProgressTracker(); startBlockChainDownload(listener); try { listener.await(); } catch (InterruptedException e) { throw new RuntimeException(e); } }
private static void syncChain() { try { setup(); int startTransactions = wallet.getTransactions(true).size(); DownloadProgressTracker listener = new DownloadProgressTracker(); peers.start(); peers.startBlockChainDownload(listener); try { listener.await(); } catch (InterruptedException e) { System.err.println("Chain download interrupted, quitting ..."); System.exit(1); } int endTransactions = wallet.getTransactions(true).size(); if (endTransactions > startTransactions) { System.out.println("Synced " + (endTransactions - startTransactions) + " transactions."); } } catch (BlockStoreException e) { System.err.println("Error reading block chain file " + chainFileName + ": " + e.getMessage()); e.printStackTrace(); } }
listener.await(); } else { Futures.addCallback(vPeerGroup.startAsync(), new FutureCallback() {
listener.await(); } else { Futures.addCallback(vPeerGroup.startAsync(), new FutureCallback() {
listener.await(); } else { Futures.addCallback(vPeerGroup.startAsync(), new FutureCallback() {
listener.await(); } else { Futures.addCallback(vPeerGroup.startAsync(), new FutureCallback() {
peers.startBlockChainDownload(bListener); bListener.await();