Skip to content

Commit

Permalink
only do early takeover on a larger amount (fix case where they're equal)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackrobison committed Jun 6, 2021
1 parent 568f25f commit 9bf81e5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lbry/wallet/server/block_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1111,7 +1111,10 @@ def get_delayed_activate_ops(name: str, claim_hash: bytes, is_new_claim: bool, t
winning_including_future_activations = max(
amounts_with_future_activations, key=lambda x: amounts_with_future_activations[x]
)
if winning_claim_hash != winning_including_future_activations: # TODO: and amount is higher and claim exists
future_winning_amount = winning_including_future_activations[winning_including_future_activations]

if winning_claim_hash != winning_including_future_activations and \
future_winning_amount > amounts[winning_claim_hash]:
print(f"\ttakeover of {name} by {winning_claim_hash.hex()} triggered early activation and "
f"takeover by {winning_including_future_activations.hex()} at {height}")
# handle a pending activated claim jumping the takeover delay when another name takes over
Expand Down

0 comments on commit 9bf81e5

Please sign in to comment.