From ef706a72f4c338bfab5e58d31174a851e7ff1d76 Mon Sep 17 00:00:00 2001 From: Forrest Voight Date: Wed, 11 Sep 2013 11:46:13 -0400 Subject: [PATCH] fixed starting a new sharechain (broken by a flaw in 76b297b6, first evident in d874cb70). thanks warren for reporting the bug! --- p2pool/data.py | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/p2pool/data.py b/p2pool/data.py index 54a287a..a988e54 100644 --- a/p2pool/data.py +++ b/p2pool/data.py @@ -158,7 +158,7 @@ class Share(object): share_data = dict(share_data, subsidy=base_subsidy + definite_fees) weights, total_weight, donation_weight = tracker.get_cumulative_weights(previous_share.share_data['previous_share_hash'] if previous_share is not None else None, - min(height, net.REAL_CHAIN_LENGTH-1), + max(0, min(height, net.REAL_CHAIN_LENGTH) - 1), 65535*net.SPREAD*bitcoin_data.target_to_average_attempts(block_target), ) assert total_weight == sum(weights.itervalues()) + donation_weight, (total_weight, sum(weights.itervalues()) + donation_weight) -- 1.7.1