X-Git-Url: https://git.novaco.in/?p=novacoin.git;a=blobdiff_plain;f=src%2Finit.cpp;h=b93f2bd0e49069a0d1a0da7090150a8a808e0614;hp=1eb28a5f6fb458388b0d2ec49eef679e44742d85;hb=8b4e446342ab1af810732445592253cd467dc7b1;hpb=ea44503ffc26beba484cd5887c4c38f7ca247260 diff --git a/src/init.cpp b/src/init.cpp index 1eb28a5..b93f2bd 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -8,6 +8,7 @@ #include "net.h" #include "init.h" #include "util.h" +#include "ntp.h" #include "ui_interface.h" #include "checkpoints.h" #include @@ -995,6 +996,23 @@ bool AppInit2() if (fServer) NewThread(ThreadRPCServer, NULL); + // ********************************************************* Step 12: add time data from four random NTP servers. + uiInterface.InitMessage(_("Synchronizing time through NTP...")); + printf("Synchronizing time through NTP...\n"); + int i = 0; + while(i < 4) { + CNetAddr ip; + int64_t nTime = NtpGetTime(ip); + + if (nTime > 0 && nTime != 2085978496) { // Skip the deliberately wrong timestamps + AddTimeData(ip, nTime); + printf("AddTimeData(%s, %" PRId64 ")\n", ip.ToString().c_str(), nTime); + } + + i++; + } + uiInterface.InitMessage(_("Done")); + printf("Done\n"); // ********************************************************* Step 12: finished uiInterface.InitMessage(_("Done loading"));