From b0d2efd61335da23379544303c9e9473932cc5a8 Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Sun, 6 Jun 2021 13:33:56 -0400 Subject: [PATCH] only do early takeover on a larger amount (fix case where they're equal) --- lbry/wallet/server/block_processor.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lbry/wallet/server/block_processor.py b/lbry/wallet/server/block_processor.py index fb280b957..8ac0d839e 100644 --- a/lbry/wallet/server/block_processor.py +++ b/lbry/wallet/server/block_processor.py @@ -1111,7 +1111,10 @@ class BlockProcessor: 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 = amounts_with_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