Changeset View
Changeset View
Standalone View
Standalone View
src/test/util/setup_common.cpp
Show First 20 Lines • Show All 254 Lines • ▼ Show 20 Lines | void TestingSetup::LoadVerifyActivateChainstate(const Config &config) { | ||||
options.check_blocks = | options.check_blocks = | ||||
m_args.GetIntArg("-checkblocks", DEFAULT_CHECKBLOCKS); | m_args.GetIntArg("-checkblocks", DEFAULT_CHECKBLOCKS); | ||||
options.check_level = m_args.GetIntArg("-checklevel", DEFAULT_CHECKLEVEL); | options.check_level = m_args.GetIntArg("-checklevel", DEFAULT_CHECKLEVEL); | ||||
options.require_full_verification = | options.require_full_verification = | ||||
m_args.IsArgSet("-checkblocks") || m_args.IsArgSet("-checklevel"); | m_args.IsArgSet("-checkblocks") || m_args.IsArgSet("-checklevel"); | ||||
auto [status, error] = LoadChainstate(chainman, m_cache_sizes, options); | auto [status, error] = LoadChainstate(chainman, m_cache_sizes, options); | ||||
assert(status == node::ChainstateLoadStatus::SUCCESS); | assert(status == node::ChainstateLoadStatus::SUCCESS); | ||||
std::tie(status, error) = | std::tie(status, error) = VerifyLoadedChainstate(chainman, options, config); | ||||
VerifyLoadedChainstate(chainman, options, GetConfig()); | |||||
assert(status == node::ChainstateLoadStatus::SUCCESS); | assert(status == node::ChainstateLoadStatus::SUCCESS); | ||||
BlockValidationState state; | BlockValidationState state; | ||||
if (!chainman.ActiveChainstate().ActivateBestChain(config, state)) { | if (!chainman.ActiveChainstate().ActivateBestChain(state)) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
strprintf("ActivateBestChain failed. (%s)", state.ToString())); | strprintf("ActivateBestChain failed. (%s)", state.ToString())); | ||||
} | } | ||||
} | } | ||||
TestingSetup::TestingSetup(const std::string &chainName, | TestingSetup::TestingSetup(const std::string &chainName, | ||||
const std::vector<const char *> &extra_args, | const std::vector<const char *> &extra_args, | ||||
const bool coins_db_in_memory, | const bool coins_db_in_memory, | ||||
▲ Show 20 Lines • Show All 351 Lines • Show Last 20 Lines |