add fixed peers immediately if the dht has no peers

This commit is contained in:
Jack Robison 2019-01-31 13:35:13 -05:00
parent e8a1953815
commit f9fd62c214
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2

View file

@ -83,7 +83,11 @@ class StreamDownloader(StreamAssembler):
])
if self.config.reflector_servers:
self.fixed_peers_handle = self.loop.call_later(
self.config.fixed_peer_delay if 'dht' not in self.config.components_to_skip else 0.0,
self.config.fixed_peer_delay if (
'dht' not in self.config.components_to_skip
and self.node
and len(self.node.protocol.routing_table.get_peers())
) else 0.0,
self.loop.create_task, _add_fixed_peers()
)