Skip to content

Commit

Permalink
call update only once
Browse files Browse the repository at this point in the history
  • Loading branch information
shyba committed Mar 10, 2021
1 parent d7694f1 commit 85509be
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lbry/extras/daemon/daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 85509be

Please sign in to comment.