git://git.novaco.in
/
novacoin.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
0c15e9b
)
Don't start NTP thread if there is NTP server active at localhost.
author
CryptoManiac
<balthazar.ad@gmail.com>
Tue, 22 Sep 2015 13:48:56 +0000 (06:48 -0700)
committer
CryptoManiac
<balthazar.ad@gmail.com>
Tue, 22 Sep 2015 13:48:56 +0000 (06:48 -0700)
src/ntp.cpp
patch
|
blob
|
history
diff --git
a/src/ntp.cpp
b/src/ntp.cpp
index
2ce65e1
..
e8d0e4a
100644
(file)
--- 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]++;