mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-02-16 04:05:50 +00: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
@ -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
|
// 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
|
// 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.
|
// 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));
|
checkArgument(!peers.contains(peer));
|
||||||
final Peer downloadPeer;
|
final Peer downloadPeer;
|
||||||
final PeerEventListener downloadListener;
|
final PeerEventListener downloadListener;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user