update channel_to_claim and claim_to_channel at the same time

This commit is contained in:
Jack Robison 2021-07-05 13:07:54 -04:00 committed by Victor Shyba
parent 287ff0a557
commit e67152ec14

View file

@ -179,24 +179,21 @@ class StagedClaimtrieItem(typing.NamedTuple):
) )
] ]
if self.signing_hash: if self.signing_hash and self.channel_signature_is_valid:
ops.append( ops.extend([
# channel by stream # channel by stream
op( op(
*Prefixes.claim_to_channel.pack_item( *Prefixes.claim_to_channel.pack_item(
self.claim_hash, self.tx_num, self.position, self.signing_hash self.claim_hash, self.tx_num, self.position, self.signing_hash
) )
) ),
)
if self.channel_signature_is_valid:
ops.append(
# stream by channel # stream by channel
op( op(
*Prefixes.channel_to_claim.pack_item( *Prefixes.channel_to_claim.pack_item(
self.signing_hash, self.name, self.tx_num, self.position, self.claim_hash self.signing_hash, self.name, self.tx_num, self.position, self.claim_hash
) )
) )
) ])
if self.reposted_claim_hash: if self.reposted_claim_hash:
ops.extend([ ops.extend([
op( op(