diff --git a/src/gossip/client/streamblocks/streamfrom.py b/src/gossip/client/streamblocks/streamfrom.py index a9c707b4..ed485cd6 100644 --- a/src/gossip/client/streamblocks/streamfrom.py +++ b/src/gossip/client/streamblocks/streamfrom.py @@ -83,7 +83,7 @@ def stream_from_peers(): while stream_times >= stream_counter: stream_counter += 1 - logger.debug("Reading block id in stream with " + peer.transport_address, terminal=True) + logger.debug("Reading block of id in stream with " + peer.transport_address, terminal=True) sock.settimeout(5) block_id = sock.recv(BLOCK_ID_SIZE) if blockdb.has_block(block_id): @@ -91,7 +91,7 @@ def stream_from_peers(): continue sock.sendall(int(1).to_bytes(1, 'big')) - logger.debug("Reading block size in stream", terminal=True) + #logger.debug("Reading block size in stream", terminal=True) sock.settimeout(5) block_size = int(sock.recv(BLOCK_SIZE_LEN)) @@ -104,9 +104,9 @@ def stream_from_peers(): sock.settimeout(5) block_data = sock.recv(block_size) - logger.debug( - "We got a block from stream, assuming it is valid", - terminal=True) + #logger.debug( + # "We got a block from stream, assuming it is valid", + # terminal=True) try: blockdb.add_block_to_db( onionrblocks.Block( @@ -119,7 +119,8 @@ def stream_from_peers(): # Tell them to keep streaming sock.sendall(int(1).to_bytes(1, 'big')) except (BrokenPipeError, TimeoutError) as e: - logger.debug(f"{e} when streaming peers", terminal=True) + pass + #logger.debug(f"{e} when streaming from peers", terminal=True) #logger.debug(traceback.format_exc()) except Exception: logger.warn(traceback.format_exc(), terminal=True) diff --git a/src/onionrutils/cleanup/__init__.py b/src/onionrutils/cleanup/__init__.py index 4293c92a..25d62774 100644 --- a/src/onionrutils/cleanup/__init__.py +++ b/src/onionrutils/cleanup/__init__.py @@ -37,3 +37,4 @@ def delete_run_files(): _safe_remove(filepaths.private_API_host_file) _safe_remove(filepaths.daemon_mark_file) _safe_remove(filepaths.lock_file) + _safe_remove(filepaths.gossip_server_socket_file) diff --git a/static-data/default-plugins/tor/announce.py b/static-data/default-plugins/tor/announce.py index ad87d2a6..ea1e81e9 100644 --- a/static-data/default-plugins/tor/announce.py +++ b/static-data/default-plugins/tor/announce.py @@ -19,8 +19,8 @@ def on_announce_rec(api, data=None): socks_address, socks_port = get_socks()[0] - if announced.removesuffix('.onion') == config.get( - 'tor.transport_address', '').removesuffix('.onion'): + if announced.replace('.onion', '') == config.get( + 'tor.transport_address', '').replace('.onion', ''): return diff --git a/static-data/default-plugins/tor/bootstrap.py b/static-data/default-plugins/tor/bootstrap.py index 74e8b118..60a0879f 100644 --- a/static-data/default-plugins/tor/bootstrap.py +++ b/static-data/default-plugins/tor/bootstrap.py @@ -46,7 +46,7 @@ def on_bootstrap(api, data): bootstrap_nodes = set(bootstrap_file_obj.read().split(',')) except FileNotFoundError: bootstrap_nodes = set() - except Exception as e: + except Exception as _: logger.warn(traceback.format_exc(), terminal=True) return else: @@ -62,7 +62,7 @@ def on_bootstrap(api, data): socks_address, socks_port = get_socks()[0] for address in bootstrap_nodes: - if address == config.get('tor.transport_address') or not address: + if address == config.get('tor.transport_address').replace('.onion', '') or not address: continue assert not address.endswith('.onion') address += '.onion'