From e1b2582ca6113c0f2766b4b7ef3b7f874d269cd0 Mon Sep 17 00:00:00 2001 From: Zlatin Balevsky Date: Sat, 24 Oct 2020 12:29:50 +0100 Subject: [PATCH] do not prepend an S to the history --- .../groovy/com/muwire/core/hostcache/H2HostCache.groovy | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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) {