Changeset View
Changeset View
Standalone View
Standalone View
src/test/util/setup_common.cpp
Show First 20 Lines • Show All 162 Lines • ▼ Show 20 Lines | BasicTestingSetup::BasicTestingSetup( | ||||
ApplyArgsManOptions(*m_node.args, validation_cache_sizes); | ApplyArgsManOptions(*m_node.args, validation_cache_sizes); | ||||
Assert(InitSignatureCache(validation_cache_sizes.signature_cache_bytes)); | Assert(InitSignatureCache(validation_cache_sizes.signature_cache_bytes)); | ||||
Assert(InitScriptExecutionCache( | Assert(InitScriptExecutionCache( | ||||
validation_cache_sizes.script_execution_cache_bytes)); | validation_cache_sizes.script_execution_cache_bytes)); | ||||
m_node.chain = interfaces::MakeChain(m_node, config.GetChainParams()); | m_node.chain = interfaces::MakeChain(m_node, config.GetChainParams()); | ||||
g_wallet_init_interface.Construct(m_node); | g_wallet_init_interface.Construct(m_node); | ||||
fCheckBlockIndex = true; | |||||
static bool noui_connected = false; | static bool noui_connected = false; | ||||
if (!noui_connected) { | if (!noui_connected) { | ||||
noui_connect(); | noui_connect(); | ||||
noui_connected = true; | noui_connected = true; | ||||
} | } | ||||
} | } | ||||
BasicTestingSetup::~BasicTestingSetup() { | BasicTestingSetup::~BasicTestingSetup() { | ||||
Show All 29 Lines | ChainTestingSetup::ChainTestingSetup( | ||||
m_node.mempool = | m_node.mempool = | ||||
std::make_unique<CTxMemPool>(MemPoolOptionsForTest(m_node)); | std::make_unique<CTxMemPool>(MemPoolOptionsForTest(m_node)); | ||||
m_cache_sizes = CalculateCacheSizes(m_args); | m_cache_sizes = CalculateCacheSizes(m_args); | ||||
ChainstateManager::Options chainman_opts{ | ChainstateManager::Options chainman_opts{ | ||||
.config = config, | .config = config, | ||||
.adjusted_time_callback = GetAdjustedTime, | .adjusted_time_callback = GetAdjustedTime, | ||||
.check_block_index = true, | |||||
}; | }; | ||||
ApplyArgsManOptions(*m_node.args, chainman_opts); | ApplyArgsManOptions(*m_node.args, chainman_opts); | ||||
m_node.chainman = std::make_unique<ChainstateManager>(chainman_opts); | m_node.chainman = std::make_unique<ChainstateManager>(chainman_opts); | ||||
m_node.chainman->m_blockman.m_block_tree_db = | m_node.chainman->m_blockman.m_block_tree_db = | ||||
std::make_unique<CBlockTreeDB>(m_cache_sizes.block_tree_db, true); | std::make_unique<CBlockTreeDB>(m_cache_sizes.block_tree_db, true); | ||||
// Call Upgrade on the block database so that the version field is set, | // Call Upgrade on the block database so that the version field is set, | ||||
// else LoadBlockIndexGuts will fail (see D8319). | // else LoadBlockIndexGuts will fail (see D8319). | ||||
m_node.chainman->m_blockman.m_block_tree_db->Upgrade(); | m_node.chainman->m_blockman.m_block_tree_db->Upgrade(); | ||||
▲ Show 20 Lines • Show All 402 Lines • Show Last 20 Lines |