|
|
@ -1135,12 +1135,14 @@ CurrentBlockchainStatus::clean_search_thread_map()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
std::lock_guard<std::mutex> lck (searching_threads_map_mtx);
|
|
|
|
std::lock_guard<std::mutex> lck (searching_threads_map_mtx);
|
|
|
|
|
|
|
|
|
|
|
|
for (auto& st: searching_threads)
|
|
|
|
for (auto it = searching_threads.begin();
|
|
|
|
|
|
|
|
it != searching_threads.end();)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
auto& st = *it;
|
|
|
|
|
|
|
|
|
|
|
|
if (search_thread_exist(st.first)
|
|
|
|
if (search_thread_exist(st.first)
|
|
|
|
&& st.second.get_functor().still_searching() == false)
|
|
|
|
&& st.second.get_functor().still_searching() == false)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
// before erasing a search thread, check if there was any
|
|
|
|
// before erasing a search thread, check if there was any
|
|
|
|
// exception thrown by it
|
|
|
|
// exception thrown by it
|
|
|
|
try
|
|
|
|
try
|
|
|
@ -1156,7 +1158,11 @@ CurrentBlockchainStatus::clean_search_thread_map()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
OMINFO << "Ereasing a search thread";
|
|
|
|
OMINFO << "Ereasing a search thread";
|
|
|
|
searching_threads.erase(st.first);
|
|
|
|
it = searching_threads.erase(it);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
++it;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|