From e67152ec14306d689c94e29f149344e87301d5a4 Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Mon, 5 Jul 2021 13:07:54 -0400 Subject: [PATCH] update channel_to_claim and claim_to_channel at the same time --- lbry/wallet/server/db/claimtrie.py | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/lbry/wallet/server/db/claimtrie.py b/lbry/wallet/server/db/claimtrie.py index 23b2cfb8d..6619bfb07 100644 --- a/lbry/wallet/server/db/claimtrie.py +++ b/lbry/wallet/server/db/claimtrie.py @@ -179,24 +179,21 @@ class StagedClaimtrieItem(typing.NamedTuple): ) ] - if self.signing_hash: - ops.append( + if self.signing_hash and self.channel_signature_is_valid: + ops.extend([ # channel by stream op( *Prefixes.claim_to_channel.pack_item( self.claim_hash, self.tx_num, self.position, self.signing_hash ) - ) - ) - if self.channel_signature_is_valid: - ops.append( - # stream by channel - op( - *Prefixes.channel_to_claim.pack_item( - self.signing_hash, self.name, self.tx_num, self.position, self.claim_hash - ) + ), + # stream by channel + op( + *Prefixes.channel_to_claim.pack_item( + self.signing_hash, self.name, self.tx_num, self.position, self.claim_hash ) ) + ]) if self.reposted_claim_hash: ops.extend([ op(