Skip to content

Commit

Permalink
Merge pull request #5487 from qstokkink/add_lt1.1.13_support
Browse files Browse the repository at this point in the history
READY: Add libtorrent 1.1.13 support for listen_succeeded_alert
  • Loading branch information
egbertbouman authored Jul 17, 2020
2 parents 698dd2e + ab57ca8 commit 4c91d4a
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,10 @@ def process_alert(self, alert, hops=0):
self._logger.debug("Got alert for unknown download %s: %s", hexlify(infohash), alert)

if alert_type == 'listen_succeeded_alert':
self.listen_ports[hops] = alert.port
# The ``port`` attribute was added in libtorrent 1.1.14.
# Older versions (most notably libtorrent 1.1.13 - the default on Ubuntu 20.04) do not have this attribute.
# We use the now-deprecated ``endpoint`` attribute for these older versions.
self.listen_ports[hops] = getattr(alert, "port", alert.endpoint[1])

elif alert_type == 'peer_disconnected_alert' and \
self.tribler_session and self.tribler_session.payout_manager:
Expand Down

0 comments on commit 4c91d4a

Please sign in to comment.