diff --git a/lbry/extras/daemon/json_response_encoder.py b/lbry/extras/daemon/json_response_encoder.py index a4246bfab..b7702f541 100644 --- a/lbry/extras/daemon/json_response_encoder.py +++ b/lbry/extras/daemon/json_response_encoder.py @@ -109,7 +109,8 @@ def encode_file_doc(): 'channel_claim_id': '(str) None if claim is not found or not signed', 'channel_name': '(str) None if claim is not found or not signed', 'claim_name': '(str) None if claim is not found else the claim name', - 'reflector_progress': '(int) reflector upload progress, 0 to 100' + 'reflector_progress': '(int) reflector upload progress, 0 to 100', + 'uploading_to_reflector': '(bool) set to True when currently uploading to reflector' } @@ -309,7 +310,8 @@ class JSONResponseEncoder(JSONEncoder): 'confirmations': (best_height + 1) - tx_height if tx_height > 0 else tx_height, 'timestamp': self.ledger.headers.estimated_timestamp(tx_height), 'is_fully_reflected': managed_stream.is_fully_reflected, - 'reflector_progress': managed_stream.reflector_progress + 'reflector_progress': managed_stream.reflector_progress, + 'uploading_to_reflector': managed_stream.uploading_to_reflector } def encode_claim(self, claim): diff --git a/lbry/stream/managed_stream.py b/lbry/stream/managed_stream.py index 5071d879e..8339f6a67 100644 --- a/lbry/stream/managed_stream.py +++ b/lbry/stream/managed_stream.py @@ -74,7 +74,8 @@ class ManagedStream: 'saving', 'finished_writing', 'started_writing', - 'finished_write_attempt' + 'finished_write_attempt', + 'uploading_to_reflector' ] def __init__(self, loop: asyncio.AbstractEventLoop, config: 'Config', blob_manager: 'BlobManager', @@ -103,6 +104,7 @@ class ManagedStream: self.fully_reflected = asyncio.Event(loop=self.loop) self.reflector_progress = 0 + self.uploading_to_reflector = False self.file_output_task: typing.Optional[asyncio.Task] = None self.delayed_stop_task: typing.Optional[asyncio.Task] = None self.streaming_responses: typing.List[typing.Tuple[Request, StreamResponse]] = [] @@ -432,6 +434,7 @@ class ManagedStream: sent = [] protocol = StreamReflectorClient(self.blob_manager, self.descriptor) try: + self.uploading_to_reflector = True await self.loop.create_connection(lambda: protocol, host, port) await protocol.send_handshake() sent_sd, needed = await protocol.send_descriptor() @@ -458,6 +461,7 @@ class ManagedStream: finally: if protocol.transport: protocol.transport.close() + self.uploading_to_reflector = False if not self.fully_reflected.is_set(): self.fully_reflected.set() await self.blob_manager.storage.update_reflected_stream(self.sd_hash, f"{host}:{port}") diff --git a/lbry/wallet/__init__.py b/lbry/wallet/__init__.py index 7ed88527b..98cfc8bb6 100644 --- a/lbry/wallet/__init__.py +++ b/lbry/wallet/__init__.py @@ -2,7 +2,7 @@ __node_daemon__ = 'lbrycrdd' __node_cli__ = 'lbrycrd-cli' __node_bin__ = '' __node_url__ = ( - 'https://github.com/lbryio/lbrycrd/releases/download/v0.17.4.4/lbrycrd-linux-1744.zip' + 'https://github.com/lbryio/lbrycrd/releases/download/v0.17.4.5/lbrycrd-linux-1745.zip' ) __spvserver__ = 'lbry.wallet.server.coin.LBCRegTest'