Skip to content

Commit

Permalink
Merge pull request #7804 from drew2a/fix/exit_nodes
Browse files Browse the repository at this point in the history
Remove leftovers of competing slots configuration.
  • Loading branch information
drew2a committed Jan 8, 2024
2 parents 0c0f8af + 3390490 commit 183bc92
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ enabled = boolean(default=True)
socks5_listen_ports = string_list(default=list('-1', '-1', '-1', '-1', '-1'))
exitnode_enabled = boolean(default=False)
random_slots = integer(default=5)
competing_slots = integer(default=15)
testnet = boolean(default=False)

[discovery_community]
Expand Down
2 changes: 0 additions & 2 deletions scripts/exit_node/run_exit_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ def make_config(options) -> TriblerConfig:
statedir = Path(os.path.join(get_root_state_directory(create=True), "tunnel-%d") % ipv8_port)
config = TriblerConfig.load(state_dir=statedir)
config.tunnel_community.random_slots = options.random_slots
config.tunnel_community.competing_slots = options.competing_slots
config.torrent_checking.enabled = False
config.ipv8.enabled = True
config.libtorrent.enabled = False
Expand Down Expand Up @@ -201,7 +200,6 @@ async def main():
parser.add_argument('--cert-file', '-e', help='Path to combined certificate/key file. If not given HTTP is used.')
parser.add_argument('--api-key', '-k', help='API key to use. If not given API key protection is disabled.')
parser.add_argument('--random_slots', '-r', default=10, type=int, help='Specifies the number of random slots')
parser.add_argument('--competing_slots', '-c', default=20, type=int, help='Specifies the number of competing slots')
parser.add_argument('--exit', '-x', action='store_const', default=False, const=True,
help='Allow being an exit-node')
parser.add_argument('--testnet', '-t', action='store_const', default=False, const=True, help='Join the testnet')
Expand Down
3 changes: 0 additions & 3 deletions src/tribler/core/components/restapi/rest/debug_endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,19 +83,16 @@ def setup_routes(self):
'schema': schema(CircuitSlotsResponse={'slots': [
schema(CircuitSlot={
'random': Integer,
'competing': Integer
})
]})
}
}
)
async def get_circuit_slots(self, request):
random_slots = self.tunnel_community.random_slots if self.tunnel_community else []
competing_slots = self.tunnel_community.competing_slots if self.tunnel_community else []
return RESTResponse({
"slots": {
"random": random_slots,
"competing": competing_slots
}
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ async def test_get_slots(rest_api, mock_tunnel_community):
"""

mock_tunnel_community.random_slots = [None, None, None, 12345]
mock_tunnel_community.competing_slots = [(0, None), (12345, 12345)]
response_json = await do_request(rest_api, 'debug/circuits/slots', expected_code=200)
assert len(response_json["slots"]["random"]) == 4

Expand Down

0 comments on commit 183bc92

Please sign in to comment.