mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-02-23 22:46:56 +01:00
PeerGroup: Fix NullPointerException in handleNewPeer() if no download peer could be selected.
This commit is contained in:
parent
5d6ae4082b
commit
e3e4e3f32a
1 changed files with 8 additions and 5 deletions
|
@ -1515,11 +1515,14 @@ public class PeerGroup implements TransactionBroadcaster {
|
|||
for (Wallet wallet : wallets)
|
||||
peer.addWallet(wallet);
|
||||
if (downloadPeer == null) {
|
||||
// Kick off chain download if we aren't already doing it.
|
||||
setDownloadPeer(selectDownloadPeer(peers));
|
||||
boolean shouldDownloadChain = downloadListener != null && chain != null;
|
||||
if (shouldDownloadChain) {
|
||||
startBlockChainDownloadFromPeer(downloadPeer);
|
||||
Peer newDownloadPeer = selectDownloadPeer(peers);
|
||||
if (newDownloadPeer != null) {
|
||||
setDownloadPeer(newDownloadPeer);
|
||||
// Kick off chain download if we aren't already doing it.
|
||||
boolean shouldDownloadChain = downloadListener != null && chain != null;
|
||||
if (shouldDownloadChain) {
|
||||
startBlockChainDownloadFromPeer(downloadPeer);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Make sure the peer knows how to upload transactions that are requested from us.
|
||||
|
|
Loading…
Add table
Reference in a new issue