From 063357120cf656aca230d17ff6cbe7e7ee134128 Mon Sep 17 00:00:00 2001 From: Zlatin Balevsky Date: Thu, 26 Jul 2018 12:44:53 +0100 Subject: [PATCH] only connect to hosts not already in progress --- .../com/muwire/core/connection/ConnectionEstablisher.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/groovy/com/muwire/core/connection/ConnectionEstablisher.groovy b/core/src/main/groovy/com/muwire/core/connection/ConnectionEstablisher.groovy index e5edd97c..e4f72884 100644 --- a/core/src/main/groovy/com/muwire/core/connection/ConnectionEstablisher.groovy +++ b/core/src/main/groovy/com/muwire/core/connection/ConnectionEstablisher.groovy @@ -78,8 +78,8 @@ class ConnectionEstablisher { } if (toTry == null) return - inProgress.add(toTry) - executor.execute({connect(toTry)} as Runnable) + if (inProgress.add(toTry)) + executor.execute({connect(toTry)} as Runnable) } private void connect(Destination toTry) {