tribler.core.tunnel.discovery ============================= .. py:module:: tribler.core.tunnel.discovery Classes ------- .. autoapisummary:: tribler.core.tunnel.discovery.GoldenRatioStrategy Module Contents --------------- .. py:class:: GoldenRatioStrategy(overlay: tribler.core.tunnel.community.TriblerTunnelCommunity, golden_ratio: float = 9 / 16, target_peers: int = 23) Bases: :py:obj:`ipv8.peerdiscovery.discovery.DiscoveryStrategy` Strategy for removing peers once we have too many in the TunnelCommunity. This strategy will remove a "normal" peer if the current ratio of "normal" peers to exit node peers is larger than the set golden ratio. This strategy will remove an exit peer if the current ratio of "normal" peers to exit node peers is smaller than the set golden ratio. .. py:attribute:: golden_ratio :value: 0.5625 .. py:attribute:: target_peers :value: 23 .. py:attribute:: intro_sent :type: dict[ipv8.peer.Peer, float] .. py:method:: take_step() -> None We are asked to update, see if we have enough peers to start culling them. If we do have enough peers, select a suitable peer to remove.