aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2015-06-14 13:10:16 +0200
committerRiccardo Spagni <ric@spagni.net>2015-06-14 13:10:18 +0200
commit2d9d6c76217c4c64e168209fb0cedfdd0e2ab883 (patch)
treec9f1ed77def3dc61b6bb91a371b06214ed809e1c
parentMerge pull request #320 (diff)
parentFix DNS checkpoint consensus code (diff)
downloadmonero-2d9d6c76217c4c64e168209fb0cedfdd0e2ab883.tar.xz
Merge pull request #321
bbc5475 Fix DNS checkpoint consensus code (moneromooo-monero)
-rw-r--r--src/cryptonote_core/checkpoints_create.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/cryptonote_core/checkpoints_create.cpp b/src/cryptonote_core/checkpoints_create.cpp
index 6f22e596d..d9bfa9807 100644
--- a/src/cryptonote_core/checkpoints_create.cpp
+++ b/src/cryptonote_core/checkpoints_create.cpp
@@ -177,24 +177,21 @@ bool load_checkpoints_from_dns(cryptonote::checkpoints& checkpoints, bool testne
records[cur_index] = tools::DNSResolver::instance().get_txt_record(url, avail, valid);
if (!avail)
{
+ records[cur_index].clear();
LOG_PRINT_L2("DNSSEC not available for checkpoint update at URL: " << url << ", skipping.");
}
if (!valid)
{
+ records[cur_index].clear();
LOG_PRINT_L2("DNSSEC validation failed for checkpoint update at URL: " << url << ", skipping.");
}
- if (records[cur_index].size() == 0 || !avail || !valid)
+ cur_index++;
+ if (cur_index == dns_urls.size())
{
- cur_index++;
- if (cur_index == dns_urls.size())
- {
- cur_index = 0;
- }
- records[cur_index].clear();
- continue;
+ cur_index = 0;
}
- break;
+ records[cur_index].clear();
} while (cur_index != first_index);
size_t num_valid_records = 0;