| 608 | } |
| 609 | |
| 610 | void BlockManager::ScanAndUnlinkAlreadyPrunedFiles() |
| 611 | { |
| 612 | AssertLockHeld(::cs_main); |
| 613 | int max_blockfile{this->MaxBlockfileNum()}; |
| 614 | if (!m_have_pruned) { |
| 615 | return; |
| 616 | } |
| 617 | |
| 618 | std::set<int> block_files_to_prune; |
| 619 | for (int file_number = 0; file_number < max_blockfile; file_number++) { |
| 620 | if (m_blockfile_info[file_number].nSize == 0) { |
| 621 | block_files_to_prune.insert(file_number); |
| 622 | } |
| 623 | } |
| 624 | |
| 625 | UnlinkPrunedFiles(block_files_to_prune); |
| 626 | } |
| 627 | |
| 628 | bool BlockManager::IsBlockPruned(const CBlockIndex& block) const |
| 629 | { |