regeneate script after modifying protobufs

This commit is contained in:
Lex Berezhny 2019-03-24 21:47:04 -04:00
parent b1720d1659
commit 5b9d41fd5c

View file

@ -1775,6 +1775,8 @@ class Daemon(metaclass=JSONRPCServerType):
else: else:
new_txo.private_key = old_txo.private_key new_txo.private_key = old_txo.private_key
new_txo.script.generate()
if not preview: if not preview:
await tx.sign([account]) await tx.sign([account])
await account.ledger.broadcast(tx) await account.ledger.broadcast(tx)
@ -1923,14 +1925,16 @@ class Daemon(metaclass=JSONRPCServerType):
) )
claim = Claim() claim = Claim()
file_stream = await self.stream_manager.create_stream(file_path) claim.stream.update(file_path=file_path, hash='0'*96, **kwargs)
claim.stream.update(file_path=file_path, hash=file_stream.sd_hash, **kwargs)
tx = await Transaction.claim_create( tx = await Transaction.claim_create(
name, claim, amount, claim_address, [account], account, channel name, claim, amount, claim_address, [account], account, channel
) )
new_txo = tx.outputs[0] new_txo = tx.outputs[0]
if not preview: if not preview:
file_stream = await self.stream_manager.create_stream(file_path)
claim.stream.hash = file_stream.sd_hash
new_txo.script.generate()
if channel: if channel:
new_txo.sign(channel) new_txo.sign(channel)
await tx.sign([account]) await tx.sign([account])
@ -2043,6 +2047,7 @@ class Daemon(metaclass=JSONRPCServerType):
if file_path is not None: if file_path is not None:
file_stream = await self.stream_manager.create_stream(file_path) file_stream = await self.stream_manager.create_stream(file_path)
new_txo.claim.stream.hash = file_stream.sd_hash new_txo.claim.stream.hash = file_stream.sd_hash
new_txo.script.generate()
if channel: if channel:
new_txo.sign(channel) new_txo.sign(channel)
await tx.sign([account]) await tx.sign([account])