mirror of
https://github.com/monero-project/monero.git
synced 2026-01-18 15:46:59 -08:00
DNS checkpoint loading for testnet should now be correct
This commit is contained in:
@@ -112,7 +112,7 @@ bool load_checkpoints_from_json(cryptonote::checkpoints& checkpoints, std::strin
|
||||
return true;
|
||||
}
|
||||
|
||||
bool load_checkpoints_from_dns(cryptonote::checkpoints& checkpoints)
|
||||
bool load_checkpoints_from_dns(cryptonote::checkpoints& checkpoints, bool testnet)
|
||||
{
|
||||
// All four MoneroPulse domains have DNSSEC on and valid
|
||||
static const std::vector<std::string> dns_urls = { "checkpoints.moneropulse.se"
|
||||
@@ -120,6 +120,12 @@ bool load_checkpoints_from_dns(cryptonote::checkpoints& checkpoints)
|
||||
, "checkpoints.moneropulse.net"
|
||||
, "checkpoints.moneropulse.co"
|
||||
};
|
||||
|
||||
static const std::vector<std::string> testnet_dns_urls = { "testpoints.moneropulse.se"
|
||||
, "testpoints.moneropulse.org"
|
||||
, "testpoints.moneropulse.net"
|
||||
, "testpoints.moneropulse.co"
|
||||
};
|
||||
bool avail, valid;
|
||||
std::vector<std::string> records;
|
||||
|
||||
@@ -131,7 +137,14 @@ bool load_checkpoints_from_dns(cryptonote::checkpoints& checkpoints)
|
||||
size_t cur_index = first_index;
|
||||
do
|
||||
{
|
||||
records = tools::DNSResolver::instance().get_txt_record(dns_urls[cur_index], avail, valid);
|
||||
if (testnet)
|
||||
{
|
||||
records = tools::DNSResolver::instance().get_txt_record(testnet_dns_urls[cur_index], avail, valid);
|
||||
}
|
||||
else
|
||||
{
|
||||
records = tools::DNSResolver::instance().get_txt_record(dns_urls[cur_index], avail, valid);
|
||||
}
|
||||
if (records.size() == 0 || (avail && !valid))
|
||||
{
|
||||
cur_index++;
|
||||
|
||||
Reference in New Issue
Block a user