diff --git a/lbrynet/daemon/Daemon.py b/lbrynet/daemon/Daemon.py index f01bb524c..1a4f65f09 100644 --- a/lbrynet/daemon/Daemon.py +++ b/lbrynet/daemon/Daemon.py @@ -314,7 +314,8 @@ class Daemon(AuthJSONRPCServer): reflector_factory = reflector_server_factory( self.session.peer_manager, self.session.blob_manager, - self.stream_info_manager + self.stream_info_manager, + self.lbry_file_manager ) try: self.reflector_server_port = reactor.listenTCP(self.reflector_port, diff --git a/lbrynet/file_manager/EncryptedFileManager.py b/lbrynet/file_manager/EncryptedFileManager.py index 517e33f12..9d88d891c 100644 --- a/lbrynet/file_manager/EncryptedFileManager.py +++ b/lbrynet/file_manager/EncryptedFileManager.py @@ -186,7 +186,7 @@ class EncryptedFileManager(object): def add_lbry_file(self, stream_hash, payment_rate_manager=None, blob_data_rate=None, download_directory=None, file_name=None): if not payment_rate_manager: - payment_rate_manager = self.sesion.payment_rate_manager + payment_rate_manager = self.session.payment_rate_manager rowid = yield self._save_lbry_file(stream_hash, blob_data_rate) lbry_file = yield self.start_lbry_file(rowid, stream_hash, payment_rate_manager, blob_data_rate, download_directory, diff --git a/lbrynet/reflector/server/server.py b/lbrynet/reflector/server/server.py index d7ddc4018..1651eb6b0 100644 --- a/lbrynet/reflector/server/server.py +++ b/lbrynet/reflector/server/server.py @@ -33,6 +33,7 @@ class ReflectorServer(Protocol): self.peer = self.factory.peer_manager.get_peer(peer_info.host, peer_info.port) self.blob_manager = self.factory.blob_manager self.stream_info_manager = self.factory.stream_info_manager + self.lbry_file_manager = self.factory.lbry_file_manager self.protocol_version = self.factory.protocol_version self.received_handshake = False self.peer_version = None @@ -107,6 +108,7 @@ class ReflectorServer(Protocol): yield save_sd_info(self.stream_info_manager, sd_info) yield self.stream_info_manager.save_sd_blob_hash_to_stream(sd_info['stream_hash'], blob.blob_hash) + yield self.lbry_file_manager.add_lbry_file(sd_info['stream_hash']) should_announce = True # if we already have the head blob, set it to be announced now that we know it's @@ -399,10 +401,11 @@ class ReflectorServer(Protocol): class ReflectorServerFactory(ServerFactory): protocol = ReflectorServer - def __init__(self, peer_manager, blob_manager, stream_info_manager): + def __init__(self, peer_manager, blob_manager, stream_info_manager, lbry_file_manager): self.peer_manager = peer_manager self.blob_manager = blob_manager self.stream_info_manager = stream_info_manager + self.lbry_file_manager = lbry_file_manager self.protocol_version = REFLECTOR_V2 def buildProtocol(self, addr):