Revert "remove unbound"
This reverts commit d9e982cba569c72a17801857addd4fb9ad929449.
This commit is contained in:
parent
03743db2ed
commit
8f17e8c0af
|
@ -208,6 +208,7 @@ if(NOT MANUAL_SUBMODULES)
|
||||||
|
|
||||||
message(STATUS "Checking submodules")
|
message(STATUS "Checking submodules")
|
||||||
check_submodule(external/miniupnp)
|
check_submodule(external/miniupnp)
|
||||||
|
check_submodule(external/unbound)
|
||||||
check_submodule(external/rapidjson)
|
check_submodule(external/rapidjson)
|
||||||
check_submodule(external/trezor-common)
|
check_submodule(external/trezor-common)
|
||||||
check_submodule(external/RandomWOW)
|
check_submodule(external/RandomWOW)
|
||||||
|
@ -473,6 +474,8 @@ else()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Final setup for libunbound
|
# Final setup for libunbound
|
||||||
|
include_directories(${UNBOUND_INCLUDE})
|
||||||
|
link_directories(${UNBOUND_LIBRARY_DIRS})
|
||||||
|
|
||||||
# Final setup for easylogging++
|
# Final setup for easylogging++
|
||||||
include_directories(${EASYLOGGING_INCLUDE})
|
include_directories(${EASYLOGGING_INCLUDE})
|
||||||
|
|
|
@ -71,8 +71,7 @@ else()
|
||||||
set(UPNP_LIBRARIES "libminiupnpc-static" PARENT_SCOPE)
|
set(UPNP_LIBRARIES "libminiupnpc-static" PARENT_SCOPE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(UNBOUND_INCLUDE_DIR unbound_dummy_include_dir)
|
find_package(Unbound)
|
||||||
set(UNBOUND_LIBRARIES unbound_dummy_libraries)
|
|
||||||
|
|
||||||
if(NOT UNBOUND_INCLUDE_DIR OR STATIC)
|
if(NOT UNBOUND_INCLUDE_DIR OR STATIC)
|
||||||
# NOTE: If STATIC is true, CMAKE_FIND_LIBRARY_SUFFIXES has been reordered.
|
# NOTE: If STATIC is true, CMAKE_FIND_LIBRARY_SUFFIXES has been reordered.
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
|
|
||||||
#include "checkpoints.h"
|
#include "checkpoints.h"
|
||||||
|
|
||||||
|
#include "common/dns_utils.h"
|
||||||
#include "string_tools.h"
|
#include "string_tools.h"
|
||||||
#include "storages/portable_storage_template_helper.h" // epee json include
|
#include "storages/portable_storage_template_helper.h" // epee json include
|
||||||
#include "serialization/keyvalue_serialization.h"
|
#include "serialization/keyvalue_serialization.h"
|
||||||
|
@ -278,6 +279,7 @@ namespace cryptonote
|
||||||
static const std::vector<std::string> stagenet_dns_urls = {
|
static const std::vector<std::string> stagenet_dns_urls = {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (!tools::dns_utils::load_txt_records_from_dns(records, nettype == TESTNET ? testnet_dns_urls : nettype == STAGENET ? stagenet_dns_urls : dns_urls))
|
||||||
return true; // why true ?
|
return true; // why true ?
|
||||||
|
|
||||||
for (const auto& record : records)
|
for (const auto& record : records)
|
||||||
|
|
|
@ -31,6 +31,7 @@ include_directories(SYSTEM ${OPENSSL_INCLUDE_DIR})
|
||||||
set(common_sources
|
set(common_sources
|
||||||
base58.cpp
|
base58.cpp
|
||||||
command_line.cpp
|
command_line.cpp
|
||||||
|
dns_utils.cpp
|
||||||
download.cpp
|
download.cpp
|
||||||
error.cpp
|
error.cpp
|
||||||
expect.cpp
|
expect.cpp
|
||||||
|
@ -63,6 +64,7 @@ set(common_private_headers
|
||||||
boost_serialization_helper.h
|
boost_serialization_helper.h
|
||||||
command_line.h
|
command_line.h
|
||||||
common_fwd.h
|
common_fwd.h
|
||||||
|
dns_utils.h
|
||||||
download.h
|
download.h
|
||||||
error.h
|
error.h
|
||||||
expect.h
|
expect.h
|
||||||
|
@ -96,6 +98,7 @@ monero_add_library(common
|
||||||
target_link_libraries(common
|
target_link_libraries(common
|
||||||
PUBLIC
|
PUBLIC
|
||||||
cncrypto
|
cncrypto
|
||||||
|
${UNBOUND_LIBRARY}
|
||||||
${LIBUNWIND_LIBRARIES}
|
${LIBUNWIND_LIBRARIES}
|
||||||
${Boost_DATE_TIME_LIBRARY}
|
${Boost_DATE_TIME_LIBRARY}
|
||||||
${Boost_FILESYSTEM_LIBRARY}
|
${Boost_FILESYSTEM_LIBRARY}
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
#include <boost/algorithm/string.hpp>
|
#include <boost/algorithm/string.hpp>
|
||||||
#include "misc_log_ex.h"
|
#include "misc_log_ex.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
#include "dns_utils.h"
|
||||||
#include "updates.h"
|
#include "updates.h"
|
||||||
|
|
||||||
#undef MONERO_DEFAULT_LOG_CATEGORY
|
#undef MONERO_DEFAULT_LOG_CATEGORY
|
||||||
|
@ -47,6 +48,7 @@ namespace tools
|
||||||
static const std::vector<std::string> dns_urls = {
|
static const std::vector<std::string> dns_urls = {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (!tools::dns_utils::load_txt_records_from_dns(records, dns_urls))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
for (const auto& record : records)
|
for (const auto& record : records)
|
||||||
|
|
|
@ -54,6 +54,7 @@
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "unbound.h"
|
||||||
|
|
||||||
#include "include_base_utils.h"
|
#include "include_base_utils.h"
|
||||||
#include "file_io_utils.h"
|
#include "file_io_utils.h"
|
||||||
|
@ -672,7 +673,6 @@ std::string get_nix_version_display_string()
|
||||||
return std::error_code(code, std::system_category());
|
return std::error_code(code, std::system_category());
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
static bool unbound_built_with_threads()
|
static bool unbound_built_with_threads()
|
||||||
{
|
{
|
||||||
ub_ctx *ctx = ub_ctx_create();
|
ub_ctx *ctx = ub_ctx_create();
|
||||||
|
@ -687,7 +687,6 @@ std::string get_nix_version_display_string()
|
||||||
MINFO("libunbound was built " << (with_threads ? "with" : "without") << " threads");
|
MINFO("libunbound was built " << (with_threads ? "with" : "without") << " threads");
|
||||||
return with_threads;
|
return with_threads;
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
bool sanitize_locale()
|
bool sanitize_locale()
|
||||||
{
|
{
|
||||||
|
@ -797,6 +796,9 @@ std::string get_nix_version_display_string()
|
||||||
OPENSSL_init_ssl(0, NULL);
|
OPENSSL_init_ssl(0, NULL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (!unbound_built_with_threads())
|
||||||
|
MCLOG_RED(el::Level::Warning, "global", "libunbound was not built with threads enabled - crashes may occur");
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
void set_strict_default_file_permissions(bool strict)
|
void set_strict_default_file_permissions(bool strict)
|
||||||
|
|
|
@ -41,6 +41,7 @@ using namespace epee;
|
||||||
#include "common/base58.h"
|
#include "common/base58.h"
|
||||||
#include "crypto/hash.h"
|
#include "crypto/hash.h"
|
||||||
#include "int-util.h"
|
#include "int-util.h"
|
||||||
|
#include "common/dns_utils.h"
|
||||||
|
|
||||||
#undef MONERO_DEFAULT_LOG_CATEGORY
|
#undef MONERO_DEFAULT_LOG_CATEGORY
|
||||||
#define MONERO_DEFAULT_LOG_CATEGORY "cn"
|
#define MONERO_DEFAULT_LOG_CATEGORY "cn"
|
||||||
|
@ -298,7 +299,7 @@ namespace cryptonote {
|
||||||
if (get_account_address_from_str(info, nettype, str_or_url))
|
if (get_account_address_from_str(info, nettype, str_or_url))
|
||||||
return true;
|
return true;
|
||||||
bool dnssec_valid;
|
bool dnssec_valid;
|
||||||
std::string address_str;
|
std::string address_str = tools::dns_utils::get_account_address_as_str_from_url(str_or_url, dnssec_valid, dns_confirm);
|
||||||
return !address_str.empty() &&
|
return !address_str.empty() &&
|
||||||
get_account_address_from_str(info, nettype, address_str);
|
get_account_address_from_str(info, nettype, address_str);
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
||||||
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
#include "common/dns_utils.h"
|
||||||
#include "common/command_line.h"
|
#include "common/command_line.h"
|
||||||
#include "daemon/command_parser_executor.h"
|
#include "daemon/command_parser_executor.h"
|
||||||
|
|
||||||
|
@ -344,7 +345,8 @@ bool t_command_parser_executor::start_mining(const std::vector<std::string>& arg
|
||||||
if(!cryptonote::get_account_address_from_str(info, cryptonote::STAGENET, args.front()))
|
if(!cryptonote::get_account_address_from_str(info, cryptonote::STAGENET, args.front()))
|
||||||
{
|
{
|
||||||
bool dnssec_valid;
|
bool dnssec_valid;
|
||||||
std::string address_str;
|
std::string address_str = tools::dns_utils::get_account_address_as_str_from_url(args.front(), dnssec_valid,
|
||||||
|
[](const std::string &url, const std::vector<std::string> &addresses, bool dnssec_valid){return addresses[0];});
|
||||||
if(!cryptonote::get_account_address_from_str(info, cryptonote::MAINNET, address_str))
|
if(!cryptonote::get_account_address_from_str(info, cryptonote::MAINNET, address_str))
|
||||||
{
|
{
|
||||||
if(!cryptonote::get_account_address_from_str(info, cryptonote::TESTNET, address_str))
|
if(!cryptonote::get_account_address_from_str(info, cryptonote::TESTNET, address_str))
|
||||||
|
|
|
@ -689,6 +689,7 @@ namespace nodetool
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
addr_list = tools::DNSResolver::instance().get_ipv4(addr_str, avail, valid);
|
||||||
MDEBUG("dns_threads[" << result_index << "] DNS resolve done");
|
MDEBUG("dns_threads[" << result_index << "] DNS resolve done");
|
||||||
boost::this_thread::interruption_point();
|
boost::this_thread::interruption_point();
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,6 +50,7 @@
|
||||||
#include "common/i18n.h"
|
#include "common/i18n.h"
|
||||||
#include "common/command_line.h"
|
#include "common/command_line.h"
|
||||||
#include "common/util.h"
|
#include "common/util.h"
|
||||||
|
#include "common/dns_utils.h"
|
||||||
#include "common/base58.h"
|
#include "common/base58.h"
|
||||||
#include "common/scoped_message_writer.h"
|
#include "common/scoped_message_writer.h"
|
||||||
#include "cryptonote_protocol/cryptonote_protocol_handler.h"
|
#include "cryptonote_protocol/cryptonote_protocol_handler.h"
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
#include "wallet_manager.h"
|
#include "wallet_manager.h"
|
||||||
#include "wallet.h"
|
#include "wallet.h"
|
||||||
#include "common_defines.h"
|
#include "common_defines.h"
|
||||||
|
#include "common/dns_utils.h"
|
||||||
#include "common/util.h"
|
#include "common/util.h"
|
||||||
#include "common/updates.h"
|
#include "common/updates.h"
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
|
@ -335,7 +336,7 @@ bool WalletManagerImpl::stopMining()
|
||||||
|
|
||||||
std::string WalletManagerImpl::resolveOpenAlias(const std::string &address, bool &dnssec_valid) const
|
std::string WalletManagerImpl::resolveOpenAlias(const std::string &address, bool &dnssec_valid) const
|
||||||
{
|
{
|
||||||
std::vector<std::string> addresses;
|
std::vector<std::string> addresses = tools::dns_utils::addresses_from_url(address, dnssec_valid);
|
||||||
if (addresses.empty())
|
if (addresses.empty())
|
||||||
return "";
|
return "";
|
||||||
return addresses.front();
|
return addresses.front();
|
||||||
|
|
|
@ -75,6 +75,7 @@ using namespace epee;
|
||||||
#include "memwipe.h"
|
#include "memwipe.h"
|
||||||
#include "common/base58.h"
|
#include "common/base58.h"
|
||||||
#include "common/combinator.h"
|
#include "common/combinator.h"
|
||||||
|
#include "common/dns_utils.h"
|
||||||
#include "common/notify.h"
|
#include "common/notify.h"
|
||||||
#include "common/perf_timer.h"
|
#include "common/perf_timer.h"
|
||||||
#include "ringct/rctSigs.h"
|
#include "ringct/rctSigs.h"
|
||||||
|
@ -13451,7 +13452,7 @@ uint64_t wallet2::get_segregation_fork_height() const
|
||||||
const uint64_t current_height = get_blockchain_current_height();
|
const uint64_t current_height = get_blockchain_current_height();
|
||||||
uint64_t best_diff = std::numeric_limits<uint64_t>::max(), best_height = 0;
|
uint64_t best_diff = std::numeric_limits<uint64_t>::max(), best_height = 0;
|
||||||
std::vector<std::string> records;
|
std::vector<std::string> records;
|
||||||
if (false)
|
if (tools::dns_utils::load_txt_records_from_dns(records, dns_urls))
|
||||||
{
|
{
|
||||||
for (const auto& record : records)
|
for (const auto& record : records)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue