MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / create_chainman

Function create_chainman

src/test/kernel/test_kernel.cpp:783–807  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

781}
782
783std::unique_ptr<ChainMan> create_chainman(TestDirectory& test_directory,
784 bool reindex,
785 bool wipe_chainstate,
786 bool block_tree_db_in_memory,
787 bool chainstate_db_in_memory,
788 Context& context)
789{
790 ChainstateManagerOptions chainman_opts{context, PathToString(test_directory.m_directory), PathToString(test_directory.m_directory / "blocks")};
791
792 if (reindex) {
793 chainman_opts.SetWipeDbs(/*wipe_block_tree=*/reindex, /*wipe_chainstate=*/reindex);
794 }
795 if (wipe_chainstate) {
796 chainman_opts.SetWipeDbs(/*wipe_block_tree=*/false, /*wipe_chainstate=*/wipe_chainstate);
797 }
798 if (block_tree_db_in_memory) {
799 chainman_opts.UpdateBlockTreeDbInMemory(block_tree_db_in_memory);
800 }
801 if (chainstate_db_in_memory) {
802 chainman_opts.UpdateChainstateDbInMemory(chainstate_db_in_memory);
803 }
804
805 auto chainman{std::make_unique<ChainMan>(context, chainman_opts)};
806 return chainman;
807}
808
809void chainman_reindex_test(TestDirectory& test_directory)
810{

Callers 4

chainman_reindex_testFunction · 0.85
BOOST_AUTO_TEST_CASEFunction · 0.85

Calls 4

PathToStringFunction · 0.85
SetWipeDbsMethod · 0.80

Tested by

no test coverage detected