From 85509bea0ee0d19c9eff60eafa7a61cd049d3238 Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Wed, 10 Mar 2021 19:13:32 -0300 Subject: [PATCH] call update only once --- lbry/extras/daemon/daemon.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lbry/extras/daemon/daemon.py b/lbry/extras/daemon/daemon.py index a190eae42e..4d638fa9ea 100644 --- a/lbry/extras/daemon/daemon.py +++ b/lbry/extras/daemon/daemon.py @@ -3288,19 +3288,19 @@ async def jsonrpc_stream_create( kwargs.update(spec) claim = Claim() - claim.stream.update(**kwargs) if file_path is not None: - claim.stream.update(file_path=file_path, sd_hash='0' * 96) + claim.stream.update(file_path=file_path, sd_hash='0' * 96, **kwargs) + else: + claim.stream.update(**kwargs) tx = await Transaction.claim_create( name, claim, amount, claim_address, funding_accounts, funding_accounts[0], channel ) new_txo = tx.outputs[0] file_stream = None - if not preview: - if file_path is not None: - file_stream = await self.file_manager.create_stream(file_path) - claim.stream.source.sd_hash = file_stream.sd_hash + if not preview and file_path is not None: + file_stream = await self.file_manager.create_stream(file_path) + claim.stream.source.sd_hash = file_stream.sd_hash new_txo.script.generate() if channel: