mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-02-24 14:50:57 +01:00
Fix a bug that could cause failure to reach the requested number of peers if peer connections failed immediately due to unroutable addresses.
This commit is contained in:
parent
07011be796
commit
8e91459dcc
1 changed files with 4 additions and 1 deletions
|
@ -804,7 +804,10 @@ public class PeerGroup extends AbstractIdleService {
|
|||
// This can run on any Netty worker thread. Because connectToAnyPeer() must run unlocked to avoid circular
|
||||
// deadlock, this method must run largely unlocked too. Some members are thread-safe and others aren't, so
|
||||
// we synchronize only the parts that need it.
|
||||
if (!isRunning()) return;
|
||||
|
||||
// Peer deaths can occur during startup if a connect attempt after peer discovery aborts immediately.
|
||||
if (state() != State.RUNNING && state() != State.STARTING) return;
|
||||
|
||||
checkArgument(!peers.contains(peer));
|
||||
final Peer downloadPeer;
|
||||
final PeerEventListener downloadListener;
|
||||
|
|
Loading…
Add table
Reference in a new issue