full node validation

This commit is contained in:
andrew (from workstation) 2020-05-20 19:04:32 +02:00
parent 6737c6f602
commit 91d4bc2f1c

View File

@ -3577,34 +3577,26 @@ void FileManager::memory_cleanup() {
/* DESTROY INVALID file_hash_to_file_id_ */
for (const auto &pair : file_hash_to_file_id_) {
if (pair.second.fast_get() != 0) {
auto &file = file_id_info_[pair.second.fast_get()];
auto &file = file_id_info_[pair.second.fast_get()];
if (file.node_id_ == 0) {
file_hash_to_file_id_.erase(pair.first);
}
if (file_nodes_[file.node_id_] == nullptr) {
file_hash_to_file_id_.erase(pair.first);
}
}
/* DESTROY INVALID local_location_to_file_id_ */
for (const auto &pair : local_location_to_file_id_) {
if (pair.second.fast_get() != 0) {
auto &file = file_id_info_[pair.second.fast_get()];
if (file.node_id_ == 0) {
local_location_to_file_id_.erase(pair.first);
}
auto &file = file_id_info_[pair.second.fast_get()];
if (file_nodes_[file.node_id_] == nullptr) {
local_location_to_file_id_.erase(pair.first);
}
}
/* DESTROY INVALID generate_location_to_file_id_ */
for (const auto &pair : generate_location_to_file_id_) {
if (pair.second.fast_get() != 0) {
auto &file = file_id_info_[pair.second.fast_get()];
if (file.node_id_ == 0) {
generate_location_to_file_id_.erase(pair.first);
}
auto &file = file_id_info_[pair.second.fast_get()];
if (file_nodes_[file.node_id_] == nullptr) {
generate_location_to_file_id_.erase(pair.first);
}
}