| 618 | class Read; |
| 619 | |
| 620 | void DeleteAllBlockFiles() |
| 621 | { |
| 622 | if (boost::filesystem::exists(GetBlockPosFilename(CDiskBlockPos(0, 0), "blk"))) |
| 623 | return; |
| 624 | |
| 625 | LogPrintf("Removing all blk?????.dat and rev?????.dat files for -reindex with -prune\n"); |
| 626 | boost::filesystem::path blocksdir = GetDataDir() / "blocks"; |
| 627 | for (boost::filesystem::directory_iterator it(blocksdir); it != boost::filesystem::directory_iterator(); it++) { |
| 628 | if (is_regular_file(*it)) { |
| 629 | if ((it->path().filename().string().length() == 12) && |
| 630 | (it->path().filename().string().substr(8,4) == ".dat") && |
| 631 | ((it->path().filename().string().substr(0,3) == "blk") || |
| 632 | (it->path().filename().string().substr(0,3) == "rev"))) |
| 633 | boost::filesystem::remove(it->path()); |
| 634 | } |
| 635 | } |
| 636 | } |
| 637 | |
| 638 | void ThreadImport(std::vector<boost::filesystem::path> vImportFiles) |
| 639 | { |
no test coverage detected