mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
refactor: Reduce number of LoadChainstate return values
This commit is contained in:
@@ -225,11 +225,11 @@ TestingSetup::TestingSetup(const std::string& chainName, const std::vector<const
|
||||
options.prune = node::fPruneMode;
|
||||
options.check_blocks = m_args.GetIntArg("-checkblocks", DEFAULT_CHECKBLOCKS);
|
||||
options.check_level = m_args.GetIntArg("-checklevel", DEFAULT_CHECKLEVEL);
|
||||
auto maybe_load_error = LoadChainstate(*Assert(m_node.chainman), m_cache_sizes, options);
|
||||
assert(!maybe_load_error.has_value());
|
||||
auto [status, error] = LoadChainstate(*Assert(m_node.chainman), m_cache_sizes, options);
|
||||
assert(status == node::ChainstateLoadStatus::SUCCESS);
|
||||
|
||||
auto maybe_verify_error = VerifyLoadedChainstate(*Assert(m_node.chainman), options);
|
||||
assert(!maybe_verify_error.has_value());
|
||||
std::tie(status, error) = VerifyLoadedChainstate(*Assert(m_node.chainman), options);
|
||||
assert(status == node::ChainstateLoadStatus::SUCCESS);
|
||||
|
||||
BlockValidationState state;
|
||||
if (!m_node.chainman->ActiveChainstate().ActivateBestChain(state)) {
|
||||
|
||||
Reference in New Issue
Block a user