validation: Move FindFilesToPrune{,Manual} to BlockManager

[META] No behaviour change is intended in this commit.
[META] This commit should be followed up by removing the comments and
       assertions meant only to show that the change is correct.

Also stop FindFilesToPrune{,Manual} from unnecessary reaching for
::ChainActive() by passing in the necessary information.
This commit is contained in:
Carl Dong
2020-08-25 19:38:23 -04:00
parent f8d4975ab3
commit 3f5b5f3f6d
2 changed files with 60 additions and 16 deletions

View File

@@ -356,7 +356,15 @@ struct CBlockIndexWorkComparator
* This data is used mostly in `CChainState` - information about, e.g.,
* candidate tips is not maintained here.
*/
class BlockManager {
class BlockManager
{
friend CChainState;
private:
// See definition for documentation
void FindFilesToPruneManual(std::set<int>& setFilesToPrune, int nManualPruneHeight, int chain_tip_height);
void FindFilesToPrune(std::set<int>& setFilesToPrune, uint64_t nPruneAfterHeight, int chain_tip_height, bool is_ibd);
public:
BlockMap m_block_index GUARDED_BY(cs_main);