From: Forrest Voight Date: Wed, 11 Sep 2013 15:46:13 +0000 (-0400) Subject: fixed starting a new sharechain (broken by a flaw in 76b297b6, first evident in d874c... X-Git-Tag: 13.4~23 X-Git-Url: https://git.novaco.in/?p=p2pool.git;a=commitdiff_plain;h=ef706a72f4c338bfab5e58d31174a851e7ff1d76 fixed starting a new sharechain (broken by a flaw in 76b297b6, first evident in d874cb70). thanks warren for reporting the bug! --- 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)