X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Fntp.cpp;fp=src%2Fntp.cpp;h=e8d0e4adde8c76c91f3f0f4cd2266aedd7973242;hb=87e8328be601171f591c267d36c08910e3e7cce6;hp=2ce65e1cd847e3921b8515ef8a27aa77e47b1151;hpb=0c15e9be384df1db22a714c3ec77e9902df0492f;p=novacoin.git diff --git a/src/ntp.cpp b/src/ntp.cpp index 2ce65e1..e8d0e4a 100644 --- a/src/ntp.cpp +++ b/src/ntp.cpp @@ -424,6 +424,16 @@ void ThreadNtpSamples(void* parg) { // Maximum offset is 2 hours. const int64_t nMaxOffset = 7200; + printf("Trying to find NTP server at localhost...\n"); + + std::string strLocalHost = "127.0.0.1"; + if (NtpGetTime(strLocalHost) == GetTime()) { + printf("There is NTP server active at localhost, we don't need NTP thread.\n"); + + nNtpOffset = 0; + return; + } + printf("ThreadNtpSamples started\n"); vnThreadsRunning[THREAD_NTP]++;