aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core/cryptonote_core.cpp
diff options
context:
space:
mode:
authorThomas Winget <tewinget@gmail.com>2015-04-22 04:36:39 -0400
committerThomas Winget <tewinget@gmail.com>2015-04-22 04:36:39 -0400
commit2717883dbaa6339ea3eb5e685852c0a40351aad9 (patch)
tree3c16dff41e195513880a1ead4b36fccecc5a64ad /src/cryptonote_core/cryptonote_core.cpp
parentupdate lmdb64 (diff)
downloadmonero-2717883dbaa6339ea3eb5e685852c0a40351aad9.tar.xz
DNS Checkpoint updating-related fixes/changes
Only one thread will be doing the updating. Two valid responses must match, and the first two that match will be used.
Diffstat (limited to 'src/cryptonote_core/cryptonote_core.cpp')
-rw-r--r--src/cryptonote_core/cryptonote_core.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/cryptonote_core/cryptonote_core.cpp b/src/cryptonote_core/cryptonote_core.cpp
index f6eaff2b1..78d034e7a 100644
--- a/src/cryptonote_core/cryptonote_core.cpp
+++ b/src/cryptonote_core/cryptonote_core.cpp
@@ -100,6 +100,8 @@ namespace cryptonote
{
if (m_testnet) return true;
+ if (m_checkpoints_updating.test_and_set()) return true;
+
bool res = true;
if (time(NULL) - m_last_dns_checkpoints_update >= 3600)
{
@@ -113,6 +115,8 @@ namespace cryptonote
m_last_json_checkpoints_update = time(NULL);
}
+ m_checkpoints_updating.clear();
+
// if anything fishy happened getting new checkpoints, bring down the house
if (!res)
{