mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-12 11:19:08 -05:00
test: call VerifyLoadedChainstate during ChainTestingSetup
for additional coverage and similarity to actual init process.
This commit is contained in:
parent
bf66e258a8
commit
826e12b010
1 changed files with 10 additions and 0 deletions
|
@ -195,6 +195,16 @@ TestingSetup::TestingSetup(const std::string& chainName, const std::vector<const
|
||||||
true);
|
true);
|
||||||
assert(!rv.has_value());
|
assert(!rv.has_value());
|
||||||
|
|
||||||
|
auto maybe_verify_failure = VerifyLoadedChainstate(
|
||||||
|
*Assert(m_node.chainman),
|
||||||
|
fReindex.load(),
|
||||||
|
m_args.GetBoolArg("-reindex-chainstate", false),
|
||||||
|
chainparams.GetConsensus(),
|
||||||
|
m_args.GetIntArg("-checkblocks", DEFAULT_CHECKBLOCKS),
|
||||||
|
m_args.GetIntArg("-checklevel", DEFAULT_CHECKLEVEL),
|
||||||
|
static_cast<int64_t(*)()>(GetTime));
|
||||||
|
assert(!maybe_verify_failure.has_value());
|
||||||
|
|
||||||
BlockValidationState state;
|
BlockValidationState state;
|
||||||
if (!m_node.chainman->ActiveChainstate().ActivateBestChain(state)) {
|
if (!m_node.chainman->ActiveChainstate().ActivateBestChain(state)) {
|
||||||
throw std::runtime_error(strprintf("ActivateBestChain failed. (%s)", state.ToString()));
|
throw std::runtime_error(strprintf("ActivateBestChain failed. (%s)", state.ToString()));
|
||||||
|
|
Loading…
Add table
Reference in a new issue