diff --git a/deluge/core/torrent.py b/deluge/core/torrent.py index 5d2a0c7eec..5d6eeefaf4 100644 --- a/deluge/core/torrent.py +++ b/deluge/core/torrent.py @@ -913,65 +913,6 @@ def get_peers(self): return ret - def get_peers_source(self): - """Get the peers source statistics for this torrent. - - A list of peers sources and the statistics about them. - - Returns: - List: The peers source statistics. - - The format for the source data:: - - { - "name": str, - "count" int, - "enabled": bool - } - """ - ret = [] - for name in ['dht', 'pex', 'lsd']: - ret.append({'name': name, 'count': 0, 'enabled': False}) - - peers = self.handle.get_peer_info() - - private = self.torrent_info.priv() - session_config = component.get('Core').get_config() - handle_flags = self.handle.flags() - - if ( - not private - and not handle_flags & lt.torrent_flags.disable_dht - and session_config['dht'] - ): - ret[0]['enabled'] = True - if ( - not private - and not handle_flags & lt.torrent_flags.disable_pex - and session_config['utpex'] - ): - ret[1]['enabled'] = True - if ( - not private - and not handle_flags & lt.torrent_flags.disable_lsd - and session_config['lsd'] - ): - ret[2]['enabled'] = True - - for peer in peers: - # We do not want to report peers that are half-connected - if peer.flags & peer.connecting or peer.flags & peer.handshake: - continue - - if peer.source & peer.dht: - ret[0]['count'] += 1 - if peer.source & peer.pex: - ret[1]['count'] += 1 - if peer.source & peer.lsd: - ret[2]['count'] += 1 - - return ret - def get_queue_position(self): """Get the torrents queue position @@ -1295,7 +1236,6 @@ def _create_status_funcs(self): 'orig_files': self.get_orig_files, 'is_seed': lambda: self.status.is_seeding, 'peers': self.get_peers, - 'peers_source': self.get_peers_source, 'queue': lambda: self.status.queue_position, 'ratio': self.get_ratio, 'completed_time': lambda: self.status.completed_time,