HARDFORK 8/3/2015 - fix calculation for number of witnesses

The new witness count calculation set a threshold equal to 50% of
all stake rather than 50% of all stake that has voted for at least 2
witnesses.
This commit is contained in:
Daniel Larimer 2015-10-02 15:39:10 -04:00
parent 44a7376219
commit 3aafd6cf55

View file

@ -130,7 +130,11 @@ void database::pay_workers( share_type& budget )
void database::update_active_witnesses()
{ try {
assert( _witness_count_histogram_buffer.size() > 0 );
share_type stake_target = _total_voting_stake / 2;
share_type stake_target = (_total_voting_stake-_witness_count_histogram_buffer[0]) / 2;
#warning HARDFORK - remove this code after Oct 2 testnet is over.
if( head_block_time() < fc::time_point_sec(1443900665) )
stake_target = _total_voting_stake/2;
/// accounts that vote for 0 or 1 witness do not get to express an opinion on
/// the number of witnesses to have (they abstain and are non-voting accounts)
@ -211,7 +215,13 @@ void database::update_active_witnesses()
void database::update_active_committee_members()
{ try {
assert( _committee_count_histogram_buffer.size() > 0 );
uint64_t stake_target = _total_voting_stake / 2;
share_type stake_target = (_total_voting_stake-_witness_count_histogram_buffer[0]) / 2;
#warning HARDFORK - remove this code after Oct 2 testnet is over.
if( head_block_time() < fc::time_point_sec(1443900665) )
stake_target = _total_voting_stake/2;
/// accounts that vote for 0 or 1 witness do not get to express an opinion on
/// the number of witnesses to have (they abstain and are non-voting accounts)
uint64_t stake_tally = 0; // _committee_count_histogram_buffer[0];