Increase timer delay

This commit is contained in:
Manfred Karrer 2015-12-27 22:18:24 +01:00
parent a4b959df22
commit 38afa428ba

View file

@ -407,17 +407,19 @@ public class PeerGroup implements MessageListener, ConnectionListener {
connectToSeedNodeTimer = UserThread.runAfterRandomDelay(() -> { connectToSeedNodeTimer = UserThread.runAfterRandomDelay(() -> {
connectToSeedNode(); connectToSeedNode();
startConnectToSeedNodeTimer(); startConnectToSeedNodeTimer();
}, 1, 2, TimeUnit.MINUTES); }, 10, 12, TimeUnit.MINUTES);
} }
private void connectToSeedNode() { private void connectToSeedNode() {
// remove enough connections first // remove enough connections first
if (getMyAddress() != null) {
checkIfConnectedPeersExceeds(MAX_CONNECTIONS_NORMAL_PRIORITY - 3); checkIfConnectedPeersExceeds(MAX_CONNECTIONS_NORMAL_PRIORITY - 3);
UserThread.runAfter(() -> { UserThread.runAfter(() -> {
resetRemainingSeedNodes(); resetRemainingSeedNodes();
authenticateToRemainingSeedNode(); authenticateToRemainingSeedNode();
}, 500, TimeUnit.MILLISECONDS); }, 500, TimeUnit.MILLISECONDS);
} }
}
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
@ -792,6 +794,7 @@ public class PeerGroup implements MessageListener, ConnectionListener {
} }
} }
@Nullable
Address getMyAddress() { Address getMyAddress() {
return networkNode.getAddress(); return networkNode.getAddress();
} }