Skip to content

Commit

Permalink
Merge pull request #4432 from xoriole/health-fixes-7.3.0
Browse files Browse the repository at this point in the history
Fixes torrent health packing and typing issues
  • Loading branch information
xoriole authored Mar 26, 2019
2 parents 20631b0 + 498b594 commit dfd104f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Tribler/Core/TorrentChecker/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -681,4 +681,4 @@ def connect_to_tracker(self):
Fakely connects to a tracker.
:return: A deferred with a callback containing an empty dictionary.
"""
return self._session.lm.ltmgr.dht_health_manager.get_health(self.infohash)
return self._session.lm.ltmgr.dht_health_manager.get_health(bytes(self.infohash))
4 changes: 2 additions & 2 deletions Tribler/community/popularity/community.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def publish_next_content(self):
content = self.content_repository.pop_content()
if content:
infohash, seeders, leechers, timestamp = content
payload = TorrentHealthPayload(infohash, seeders, leechers, timestamp)
payload = TorrentHealthPayload(bytes(infohash), seeders, leechers, timestamp)
self.send_torrent_health_response(payload)

def publish_latest_torrents(self, peer):
Expand All @@ -118,7 +118,7 @@ def publish_latest_torrents(self, peer):
torrents = self.content_repository.get_top_torrents()
self.logger.info("Publishing %d torrents to peer %s", len(torrents), peer)

to_send = [TorrentHealthPayload(str(torrent.infohash), torrent.health.seeders, torrent.health.leechers,
to_send = [TorrentHealthPayload(bytes(torrent.infohash), torrent.health.seeders, torrent.health.leechers,
torrent.health.last_check) for torrent in torrents]
for payload in to_send:
self.send_torrent_health_response(payload, peer=peer)
Expand Down

0 comments on commit dfd104f

Please sign in to comment.