Skip to content

Commit

Permalink
Merge pull request #4770 from xoriole/fix-metainfo-error-4765
Browse files Browse the repository at this point in the history
Fixed metainfo issue for torrents already in credit mining mode
  • Loading branch information
qstokkink authored Aug 26, 2019
2 parents 284b618 + eeac4d4 commit 0f2f623
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Tribler/Core/Libtorrent/LibtorrentMgr.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,8 +451,11 @@ def get_metainfo(self, infohash, timeout=30):
elif infohash not in self.metainfo_requests:
metainfo_deferred = Deferred()

# Are we already downloading the torrent? If so, use that handle
if infohash_hex in self.torrents and self.torrents[infohash_hex][0].handle:
# Are we already downloading the torrent? If so, use that handle.
# Note that if the download is already in credit mining mode and has not started then it will not
# have metadata.
if infohash_hex in self.torrents and self.torrents[infohash_hex][0].handle \
and self.torrents[infohash_hex][0].handle.has_metadata():
handle = self.torrents[infohash_hex][0].handle
self.metainfo_requests[infohash] = (handle, [metainfo_deferred])
self.check_metainfo(infohash_hex)
Expand Down

0 comments on commit 0f2f623

Please sign in to comment.