diff --git a/src/core/download_list.cc b/src/core/download_list.cc index 6293419d..83d1cbe1 100644 --- a/src/core/download_list.cc +++ b/src/core/download_list.cc @@ -374,9 +374,16 @@ DownloadList::hash_done(Download* download) { if (!download->is_open()) throw torrent::client_error("DownloadList::hash_done(...) !download->is_open()."); - if (!download->is_hash_checked() || download->is_hash_checking() || download->is_active()) + if (download->is_hash_checking() || download->is_active()) throw torrent::client_error("DownloadList::hash_done(...) download in invalid state."); + if (!download->is_hash_checked()) { + download->set_hash_failed(true); + + std::for_each(slot_map_hash_done().begin(), slot_map_hash_done().end(), download_list_call(download)); + return; + } + // Need to find some sane conditional here. Can we check the total // downloaded to ensure something was transferred, thus we didn't // just hash an already completed torrent with lacking session data?