Compare commits
4 Commits
0236fc83f4
...
7caaa829f2
Author | SHA1 | Date | |
---|---|---|---|
|
7caaa829f2 | ||
|
70c7eca9c5 | ||
|
9a0a9f11b2 | ||
|
f410f033c0 |
@ -30,11 +30,14 @@ async def do_stem_stream(
|
|||||||
try:
|
try:
|
||||||
# queues can't block because we're in async
|
# queues can't block because we're in async
|
||||||
bl = block_queue.get(block=False)
|
bl = block_queue.get(block=False)
|
||||||
|
assert hasattr(bl, 'raw')
|
||||||
except Empty:
|
except Empty:
|
||||||
remaining_time = d_phase.remaining_time()
|
remaining_time = d_phase.remaining_time()
|
||||||
await sleep(1)
|
await sleep(1)
|
||||||
else:
|
else:
|
||||||
break
|
break
|
||||||
|
if not remaining_time:
|
||||||
|
break
|
||||||
logging.info("Sending block over dandelion++")
|
logging.info("Sending block over dandelion++")
|
||||||
|
|
||||||
block_size = str(len(bl.raw)).zfill(BLOCK_SIZE_LEN)
|
block_size = str(len(bl.raw)).zfill(BLOCK_SIZE_LEN)
|
||||||
|
@ -102,6 +102,8 @@ async def diffuse_blocks(reader: 'StreamReader', writer: 'StreamWriter'):
|
|||||||
break
|
break
|
||||||
except ConnectionResetError:
|
except ConnectionResetError:
|
||||||
pass
|
pass
|
||||||
|
except IncompleteReadError:
|
||||||
|
pass
|
||||||
except Exception:
|
except Exception:
|
||||||
logging.warn(traceback.format_exc())
|
logging.warn(traceback.format_exc())
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ def create_block(
|
|||||||
def create_and_insert_block(
|
def create_and_insert_block(
|
||||||
block_data: 'base64',
|
block_data: 'base64',
|
||||||
block_type: str, ttl: int, metadata: dict) -> str:
|
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)
|
insert_block(bl)
|
||||||
return bl
|
return bl
|
||||||
|
|
||||||
|
@ -71,7 +71,11 @@ def on_get_our_transport(api, data=None):
|
|||||||
def on_gossip_start(api, data: Set[Peer] = None):
|
def on_gossip_start(api, data: Set[Peer] = None):
|
||||||
# We don't do gossip logic
|
# 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:
|
with Controller.from_socket_file(control_socket) as controller:
|
||||||
controller
|
controller
|
||||||
|
Loading…
Reference in New Issue
Block a user