diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2015-06-14 11:05:13 +0100 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2015-06-14 11:05:57 +0100 |
commit | bbc54754181943df16c6b5775f94aef200fb52e6 (patch) | |
tree | 3d7bb6b05508aeeaac515b213b17a4dc6c68a6b9 /src/cryptonote_core | |
parent | Merge pull request #312 (diff) | |
download | monero-bbc54754181943df16c6b5775f94aef200fb52e6.tar.xz |
Fix DNS checkpoint consensus code
It's supposed to load all records and pick one that it finds twice.
Diffstat (limited to 'src/cryptonote_core')
-rw-r--r-- | src/cryptonote_core/checkpoints_create.cpp | 15 |
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; |