From 5b5e5ef764873a94a4bae018eaeb3b361658c780 Mon Sep 17 00:00:00 2001 From: Kevin F Date: Sun, 20 Mar 2022 13:00:33 -0500 Subject: [PATCH] Don't bother to check if tor address in bootstrap list ends in .onion, it always shouldn't --- static-data/default-plugins/tor/bootstrap.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/static-data/default-plugins/tor/bootstrap.py b/static-data/default-plugins/tor/bootstrap.py index ff7c5839..ad2a6737 100644 --- a/static-data/default-plugins/tor/bootstrap.py +++ b/static-data/default-plugins/tor/bootstrap.py @@ -12,6 +12,7 @@ from torfilepaths import control_socket bootstrap_file = f'{os.path.dirname(os.path.realpath(__file__))}/bootstrap.txt' + def on_bootstrap(api, data): try: @@ -30,10 +31,10 @@ def on_bootstrap(api, data): socks_address, socks_port = get_socks()[0] for address in bootstrap_nodes: - if address == config.get('tor.transport_address'): + if address == config.get('tor.transport_address') or not address: continue - if not address.endswith('.onion'): - address += '.onion' + assert not address.endswith('.onion') + address += '.onion' # Tell the gossip logic that this peer is ready to connect # it will add it to data['peer_set'] if it responds to ping Thread(