pastebin - collaborative debugging tool
kpaste.net RSS


Untitled
Posted by Anonymous on Thu 7th May 2026 21:53
raw | new post

  1. commit 70e4a461966825480c62eb44037b6fa3a15341c3 (HEAD -> master)
  2. Author: plowsof <plowsof@protonmail.com>
  3. Date:   Thu May 7 20:08:28 2026 +0100
  4.  
  5.     same domain for all dns for testing
  6.  
  7. diff --git a/src/common/dns_utils.cpp b/src/common/dns_utils.cpp
  8. index 48dab6961..c336b2a05 100644
  9. --- a/src/common/dns_utils.cpp
  10. +++ b/src/common/dns_utils.cpp
  11. @@ -503,16 +503,16 @@ bool load_txt_records_from_dns(std::vector<std::string> &good_records, const std
  12.    do
  13.    {
  14.      const std::string &url = dns_urls[cur_index];
  15. -    if (!avail[cur_index])
  16. -    {
  17. -      records[cur_index].clear();
  18. -      LOG_PRINT_L2("DNSSEC not available for hostname: " << url << ", skipping.");
  19. -    }
  20. -    if (!valid[cur_index])
  21. -    {
  22. -      records[cur_index].clear();
  23. -      LOG_PRINT_L2("DNSSEC validation failed for hostname: " << url << ", skipping.");
  24. -    }
  25. +    //if (!avail[cur_index])
  26. +    //{
  27. +    //  records[cur_index].clear();
  28. +    //  LOG_PRINT_L2("DNSSEC not available for hostname: " << url << ", skipping.");
  29. +    //}
  30. +    //if (!valid[cur_index])
  31. +    //{
  32. +    //  records[cur_index].clear();
  33. +    //  LOG_PRINT_L2("DNSSEC validation failed for hostname: " << url << ", skipping.");
  34. +    //}
  35.  
  36.      cur_index++;
  37.      if (cur_index == dns_urls.size())
  38. @@ -565,6 +565,38 @@ bool load_txt_records_from_dns(std::vector<std::string> &good_records, const std
  39.    return true;
  40.  }
  41.  
  42. +bool load_chunked_txt_records_from_dns(std::vector<std::string> &good_records, const std::vector<std::string> &dns_urls)
  43. +{
  44. +  if (dns_urls.empty()) return false;
  45. +
  46. +  for (size_t chunk_idx = 0; ; ++chunk_idx)
  47. +  {
  48. +    std::vector<std::string> chunk_urls;
  49. +    chunk_urls.reserve(dns_urls.size());
  50. +    for (const auto &url : dns_urls)
  51. +      chunk_urls.push_back(std::to_string(chunk_idx) + "." + url);
  52. +
  53. +    std::vector<std::string> chunk_records;
  54. +    if (!load_txt_records_from_dns(chunk_records, chunk_urls))
  55. +    {
  56. +      MDEBUG("DNS blocklist: no consensus for chunk " << chunk_idx << ", stopping after " << chunk_idx << " chunk(s)");
  57. +      break;
  58. +    }
  59. +
  60. +    MDEBUG("Found chunk " << chunk_idx << " with " << chunk_records.size() << " record(s)");
  61. +    for (const auto &s : chunk_records)
  62. +      good_records.push_back(s);
  63. +  }
  64. +
  65. +  if (good_records.empty())
  66. +  {
  67. +    LOG_PRINT_L0("WARNING: no DNS blocklist chunks were successfully fetched");
  68. +    return false;
  69. +  }
  70. +
  71. +  return true;
  72. +}
  73. +
  74.  std::vector<std::string> parse_dns_public(const char *s)
  75.  {
  76.    unsigned ip0, ip1, ip2, ip3;
  77. diff --git a/src/common/dns_utils.h b/src/common/dns_utils.h
  78. index 334ac8a79..a763d76c0 100644
  79. --- a/src/common/dns_utils.h
  80. +++ b/src/common/dns_utils.h
  81. @@ -172,6 +172,11 @@ std::string get_account_address_as_str_from_url(const std::string& url, bool& dn
  82.  
  83.  bool load_txt_records_from_dns(std::vector<std::string> &records, const std::vector<std::string> &dns_urls);
  84.  
  85. +// Distributed banlist
  86. +// For each chunk index i, query "{i}.base_domain" across all base_dns_urls
  87. +// Stops when a chunk yields no consensus (end-of-list signal).
  88. +bool load_chunked_txt_records_from_dns(std::vector<std::string> &records, const std::vector<std::string> &dns_urls);
  89. +
  90.  std::vector<std::string> parse_dns_public(const char *s);
  91.  
  92.  }  // namespace tools::dns_utils
  93. diff --git a/src/p2p/net_node.h b/src/p2p/net_node.h
  94. index 3052cca29..c5aa5b645 100644
  95. --- a/src/p2p/net_node.h
  96. +++ b/src/p2p/net_node.h
  97. @@ -478,7 +478,7 @@ namespace nodetool
  98.      epee::math_helper::once_a_time_seconds<60*30, false> m_peerlist_store_interval;
  99.      epee::math_helper::once_a_time_seconds<60> m_gray_peerlist_housekeeping_interval;
  100.      epee::math_helper::once_a_time_seconds<3600, false> m_incoming_connections_interval;
  101. -    epee::math_helper::once_a_time_seconds<7000> m_dns_blocklist_interval;
  102. +    epee::math_helper::once_a_time_seconds<15> m_dns_blocklist_interval;
  103.  
  104.      std::list<epee::net_utils::network_address>   m_priority_peers;
  105.      std::vector<epee::net_utils::network_address> m_exclusive_peers;
  106. diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl
  107. index ce2d5346a..85f8c2653 100644
  108. --- a/src/p2p/net_node.inl
  109. +++ b/src/p2p/net_node.inl
  110. @@ -2152,17 +2152,17 @@ namespace nodetool
  111.        return true;
  112.  
  113.      static const std::vector<std::string> dns_urls = {
  114. -      "blocklist.moneropulse.se"
  115. -    , "blocklist.moneropulse.org"
  116. -    , "blocklist.moneropulse.net"
  117. -    , "blocklist.moneropulse.co"
  118. -    , "blocklist.moneropulse.fr"
  119. -    , "blocklist.moneropulse.de"
  120. -    , "blocklist.moneropulse.ch"
  121. +      "blocklist.monerodevs.org"
  122. +    , "blocklist.monerodevs.org"
  123. +    , "blocklist.monerodevs.org"
  124. +    , "blocklist.monerodevs.org"
  125. +    , "blocklist.monerodevs.org"
  126. +    , "blocklist.monerodevs.org"
  127. +    , "blocklist.monerodevs.org"
  128.      };
  129.  
  130.      std::vector<std::string> records;
  131. -    if (!tools::dns_utils::load_txt_records_from_dns(records, dns_urls))
  132. +    if (!tools::dns_utils::load_chunked_txt_records_from_dns(records, dns_urls))
  133.        return true;
  134.  
  135.      unsigned good = 0;

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at