fix handling stream with no data blobs

fixes https://github.com/lbryio/lbry/issues/905
This commit is contained in:
Jack Robison 2017-12-29 13:54:35 -05:00
parent 7a020bec05
commit 6385ab27c1
No known key found for this signature in database
GPG key ID: 284699E7404E3CFF

View file

@ -179,8 +179,12 @@ class ConnectionManager(object):
# find peers for the head blob if configured to do so
if self.seek_head_blob_first:
peers = yield request_creator.get_new_peers_for_head_blob()
peers = self.return_shuffled_peers_not_connected_to(peers, new_conns_needed)
try:
peers = yield request_creator.get_new_peers_for_head_blob()
peers = self.return_shuffled_peers_not_connected_to(peers, new_conns_needed)
except KeyError:
log.warning("%s does not have a head blob", self._get_log_name())
peers = []
else:
peers = []
@ -196,10 +200,8 @@ class ConnectionManager(object):
self._get_log_name(), self._peer_connections.keys())
log.debug("%s List of connection states: %s", self._get_log_name(),
[p_c_h.connection.state for p_c_h in self._peer_connections.values()])
defer.returnValue(peers)
def _connect_to_peer(self, peer):
if self.stopped:
return