PeerGroup.triggerConnectionsJob: Code cleanup.

This commit is contained in:
Oscar Guindzberg 2019-03-27 13:00:35 -03:00 committed by Andreas Schildbach
parent 6c944f4142
commit 52804fc8ce

View file

@ -463,8 +463,6 @@ public class PeerGroup implements TransactionBroadcaster {
discoverySuccess = discoverPeers() > 0;
}
long retryTime;
PeerAddress addrToTry;
lock.lock();
try {
if (doDiscovery) {
@ -488,12 +486,12 @@ public class PeerGroup implements TransactionBroadcaster {
// were given a fixed set of addresses in some test scenario.
}
return;
} else {
do {
addrToTry = inactives.poll();
} while (ipv6Unreachable && addrToTry.getAddr() instanceof Inet6Address);
retryTime = backoffMap.get(addrToTry).getRetryTime();
}
PeerAddress addrToTry;
do {
addrToTry = inactives.poll();
} while (ipv6Unreachable && addrToTry.getAddr() instanceof Inet6Address);
long retryTime = backoffMap.get(addrToTry).getRetryTime();
retryTime = Math.max(retryTime, groupBackoff.getRetryTime());
if (retryTime > now) {
long delay = retryTime - now;