mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
test: Setup networking globally
This commit is contained in:
@@ -49,6 +49,7 @@
|
||||
#include <txdb.h>
|
||||
#include <txmempool.h>
|
||||
#include <util/chaintype.h>
|
||||
#include <util/check.h>
|
||||
#include <util/rbf.h>
|
||||
#include <util/strencodings.h>
|
||||
#include <util/string.h>
|
||||
@@ -88,6 +89,15 @@ std::ostream& operator<<(std::ostream& os, const uint256& num)
|
||||
return os;
|
||||
}
|
||||
|
||||
struct NetworkSetup
|
||||
{
|
||||
NetworkSetup()
|
||||
{
|
||||
Assert(SetupNetworking());
|
||||
}
|
||||
};
|
||||
static NetworkSetup g_networksetup_instance;
|
||||
|
||||
BasicTestingSetup::BasicTestingSetup(const ChainType chainType, const std::vector<const char*>& extra_args)
|
||||
: m_path_root{fs::temp_directory_path() / "test_common_" PACKAGE_NAME / g_insecure_rand_ctx_temp_path.rand256().ToString()},
|
||||
m_args{}
|
||||
@@ -130,7 +140,6 @@ BasicTestingSetup::BasicTestingSetup(const ChainType chainType, const std::vecto
|
||||
LogInstance().StartLogging();
|
||||
m_node.kernel = std::make_unique<kernel::Context>();
|
||||
SetupEnvironment();
|
||||
SetupNetworking();
|
||||
|
||||
ValidationCacheSizes validation_cache_sizes{};
|
||||
ApplyArgsManOptions(*m_node.args, validation_cache_sizes);
|
||||
|
||||
Reference in New Issue
Block a user