Changeset View
Changeset View
Standalone View
Standalone View
src/init.cpp
Show First 20 Lines • Show All 1,099 Lines • ▼ Show 20 Lines | for (fs::directory_iterator it(blocksdir); it != fs::directory_iterator(); | ||||
} | } | ||||
} | } | ||||
// Remove all block files that aren't part of a contiguous set starting at | // Remove all block files that aren't part of a contiguous set starting at | ||||
// zero by walking the ordered map (keys are block file indices) by keeping | // zero by walking the ordered map (keys are block file indices) by keeping | ||||
// a separate counter. Once we hit a gap (or if 0 doesn't exist) start | // a separate counter. Once we hit a gap (or if 0 doesn't exist) start | ||||
// removing block files. | // removing block files. | ||||
int nContigCounter = 0; | int nContigCounter = 0; | ||||
for (const std::pair<std::string, fs::path> &item : mapBlockFiles) { | for (const std::pair<const std::string, fs::path> &item : mapBlockFiles) { | ||||
if (atoi(item.first) == nContigCounter) { | if (atoi(item.first) == nContigCounter) { | ||||
nContigCounter++; | nContigCounter++; | ||||
continue; | continue; | ||||
} | } | ||||
remove(item.second); | remove(item.second); | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 1,371 Lines • Show Last 20 Lines |