More than one samples seems enough.
authorCryptoManiac <balthazar@yandex.ru>
Tue, 22 Sep 2015 19:40:44 +0000 (22:40 +0300)
committerCryptoManiac <balthazar@yandex.ru>
Tue, 22 Sep 2015 19:40:44 +0000 (22:40 +0300)
src/ntp.cpp

index 60cc309..84f3301 100644 (file)
@@ -478,11 +478,11 @@ void ThreadNtpSamples(void* parg) {
                 }
             }
 
-            if (vTimeOffsets.size() > 2) {
+            if (vTimeOffsets.size() > 1) {
                 nNtpOffset = vTimeOffsets.median();
             }
             else {
-                // Not enough offsets yet, try again later.
+                // Not enough offsets yet, try to collect additional samples later.
                 nNtpOffset = INT64_MAX;
                 int nSleepMinutes = 1 + GetRandInt(4); // Sleep for 1-5 minutes.
                 for (int i = 0; i < nSleepMinutes * 60 && !fShutdown; i++)