Compare commits

...

4 Commits

4 changed files with 11 additions and 2 deletions

View File

@ -30,11 +30,14 @@ async def do_stem_stream(
try:
# queues can't block because we're in async
bl = block_queue.get(block=False)
assert hasattr(bl, 'raw')
except Empty:
remaining_time = d_phase.remaining_time()
await sleep(1)
else:
break
if not remaining_time:
break
logging.info("Sending block over dandelion++")
block_size = str(len(bl.raw)).zfill(BLOCK_SIZE_LEN)

View File

@ -102,6 +102,8 @@ async def diffuse_blocks(reader: 'StreamReader', writer: 'StreamWriter'):
break
except ConnectionResetError:
pass
except IncompleteReadError:
pass
except Exception:
logging.warn(traceback.format_exc())

View File

@ -62,7 +62,7 @@ def create_block(
def create_and_insert_block(
block_data: 'base64',
block_type: str, ttl: int, metadata: dict) -> str:
bl = _do_create_block(block_data, block_type, ttl, metadata)['id']
bl = _do_create_block(block_data, block_type, ttl, metadata)
insert_block(bl)
return bl

View File

@ -71,7 +71,11 @@ def on_get_our_transport(api, data=None):
def on_gossip_start(api, data: Set[Peer] = None):
# We don't do gossip logic
starttor.start_tor()
try:
starttor.start_tor()
except OSError:
logging.error("Tor is not in your path. Install a recent version of Tor and try again.")
return
with Controller.from_socket_file(control_socket) as controller:
controller