Compare commits
4 Commits
0236fc83f4
...
7caaa829f2
Author | SHA1 | Date | |
---|---|---|---|
|
7caaa829f2 | ||
|
70c7eca9c5 | ||
|
9a0a9f11b2 | ||
|
f410f033c0 |
@ -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)
|
||||
|
@ -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())
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user