forked from LBRYCommunity/lbry-sdk
fix duplicate update op for early activating claim
This commit is contained in:
parent
c0e2d56f55
commit
8711ece274
1 changed files with 14 additions and 18 deletions
|
@ -845,8 +845,6 @@ class BlockProcessor:
|
||||||
winning_including_future_activations = max(
|
winning_including_future_activations = max(
|
||||||
amounts_with_future_activations, key=lambda x: amounts_with_future_activations[x]
|
amounts_with_future_activations, key=lambda x: amounts_with_future_activations[x]
|
||||||
)
|
)
|
||||||
print(amounts_with_future_activations)
|
|
||||||
print(amounts)
|
|
||||||
if winning_claim_hash != winning_including_future_activations:
|
if winning_claim_hash != winning_including_future_activations:
|
||||||
print(f"\ttakeover of {name} by {winning_claim_hash.hex()} triggered early activation and "
|
print(f"\ttakeover of {name} by {winning_claim_hash.hex()} triggered early activation and "
|
||||||
f"takeover by {winning_including_future_activations.hex()} at {height}")
|
f"takeover by {winning_including_future_activations.hex()} at {height}")
|
||||||
|
@ -866,7 +864,9 @@ class BlockProcessor:
|
||||||
if (k.tx_num, k.position) == (tx_num, position):
|
if (k.tx_num, k.position) == (tx_num, position):
|
||||||
amount = tx_amount
|
amount = tx_amount
|
||||||
activation = k.height
|
activation = k.height
|
||||||
|
break
|
||||||
assert None not in (amount, activation)
|
assert None not in (amount, activation)
|
||||||
|
# update the claim that's activating early
|
||||||
ops.extend(
|
ops.extend(
|
||||||
StagedActivation(
|
StagedActivation(
|
||||||
ACTIVATED_CLAIM_TXO_TYPE, winning_including_future_activations, tx_num,
|
ACTIVATED_CLAIM_TXO_TYPE, winning_including_future_activations, tx_num,
|
||||||
|
@ -879,13 +879,10 @@ class BlockProcessor:
|
||||||
position, height, name, amount
|
position, height, name, amount
|
||||||
).get_activate_ops()
|
).get_activate_ops()
|
||||||
)
|
)
|
||||||
|
|
||||||
for (k, amount) in activate_in_future[name][winning_including_future_activations]:
|
for (k, amount) in activate_in_future[name][winning_including_future_activations]:
|
||||||
txo = (k.tx_num, k.position)
|
txo = (k.tx_num, k.position)
|
||||||
if txo in self.possible_future_support_txos[winning_including_future_activations]:
|
if txo in self.possible_future_support_txos[winning_including_future_activations]:
|
||||||
t = ACTIVATED_SUPPORT_TXO_TYPE
|
t = ACTIVATED_SUPPORT_TXO_TYPE
|
||||||
else:
|
|
||||||
t = ACTIVATED_CLAIM_TXO_TYPE
|
|
||||||
ops.extend(
|
ops.extend(
|
||||||
StagedActivation(
|
StagedActivation(
|
||||||
t, winning_including_future_activations, k.tx_num,
|
t, winning_including_future_activations, k.tx_num,
|
||||||
|
@ -898,7 +895,6 @@ class BlockProcessor:
|
||||||
k.position, height, name, amount
|
k.position, height, name, amount
|
||||||
).get_activate_ops()
|
).get_activate_ops()
|
||||||
)
|
)
|
||||||
|
|
||||||
ops.extend(get_takeover_name_ops(name, winning_including_future_activations, height, controlling))
|
ops.extend(get_takeover_name_ops(name, winning_including_future_activations, height, controlling))
|
||||||
elif not controlling or (winning_claim_hash != controlling.claim_hash and
|
elif not controlling or (winning_claim_hash != controlling.claim_hash and
|
||||||
name in names_with_abandoned_controlling_claims) or \
|
name in names_with_abandoned_controlling_claims) or \
|
||||||
|
|
Loading…
Reference in a new issue