| 781 | } |
| 782 | |
| 783 | std::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 | |
| 809 | void chainman_reindex_test(TestDirectory& test_directory) |
| 810 | { |
no test coverage detected