Fixed high CPU usage when there are no outbound connections

This commit is contained in:
Kevin F 2022-08-16 17:22:28 -05:00
parent 954f5d793d
commit 69a31d1d83
2 changed files with 3 additions and 2 deletions

View File

@ -59,7 +59,7 @@ def block_queue_processing():
while not len(gossip_peer_set):
sleep(0.2)
sleep(1)
if dandelion_phase.remaining_time() <= 15:
#logger.debug("Sleeping", terminal=True)
sleep(dandelion_phase.remaining_time())

View File

@ -130,7 +130,8 @@ def stream_from_peers():
# spawn stream threads infinitely
while True:
if not gossip_peer_set:
sleep(2)
available_set = gossip_peer_set - tried_peers
if not len(available_set) and len(tried_peers):
try: