diff --git a/core/src/main/groovy/com/muwire/core/hostcache/H2HostCache.groovy b/core/src/main/groovy/com/muwire/core/hostcache/H2HostCache.groovy index 73d803fd..2d778d1d 100644 --- a/core/src/main/groovy/com/muwire/core/hostcache/H2HostCache.groovy +++ b/core/src/main/groovy/com/muwire/core/hostcache/H2HostCache.groovy @@ -87,10 +87,14 @@ class H2HostCache extends HostCache { int fs = 0 int fr = 0 int ff = 0 - ConnectionAttemptStatus currentStatus = ConnectionAttemptStatus.SUCCESSFUL + ConnectionAttemptStatus currentStatus = null sql.eachRow("select STATUS from HOST_ATTEMPTS where DESTINATION=${d.toBase64()} ORDER BY TSTAMP") { def recordedStatus = ConnectionAttemptStatus.valueOf(it.STATUS) + if (currentStatus == null) { + currentStatus = recordedStatus + return + } switch(currentStatus) { case ConnectionAttemptStatus.SUCCESSFUL: switch(recordedStatus) {