Merge bitcoin/bitcoin#23736: test: call VerifyLoadedChainstate during ChainTestingSetup
826e12b010test: call VerifyLoadedChainstate during ChainTestingSetup (James O'Beirne) Pull request description: for additional coverage and similarity to actual init process. Followup to #23280. ACKs for top commit: dongcarl: Code Review ACK826e12b010ryanofsky: Code review ACK826e12b010Tree-SHA512: a4e7fd25e5d7a08b1e154ae6daf67c3048260a2684b0e569b544dd826693b7b969db9923b191e499cb8d8d0a2a73eb9330ff45909313145a9abb6052eb8c3ad9
This commit is contained in:
1 file changed
+10
@@ -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()));
|
||||||
|
|||||||
Reference in new issue
Block a user