diff --git a/libraries/chain/db_maint.cpp b/libraries/chain/db_maint.cpp index 7186be43e..afe264916 100644 --- a/libraries/chain/db_maint.cpp +++ b/libraries/chain/db_maint.cpp @@ -196,7 +196,12 @@ void database::pay_sons() stake_tally += _son_count_histogram_buffer[++son_count]; } } - auto sons = sort_votable_objects(std::max(son_count*2+1, (size_t)get_chain_properties().immutable_parameters.min_son_count)); + const vector> sons = [this, &son_count]{ + if( (head_block_time() >= HARDFORK_SON2_TIME) && (head_block_time() < HARDFORK_SON3_TIME) ) + return sort_votable_objects(std::max(son_count*2+1, (size_t)get_chain_properties().immutable_parameters.min_son_count)); + else + return sort_votable_objects(get_global_properties().parameters.maximum_son_count()); + }(); // After SON2 HF uint64_t total_votes = 0; for( const son_object& son : sons ) @@ -693,7 +698,12 @@ void database::update_active_sons() } const global_property_object& gpo = get_global_properties(); - auto sons = sort_votable_objects(std::max(son_count*2+1, (size_t)get_chain_properties().immutable_parameters.min_son_count)); + const vector> sons = [this, &son_count]{ + if( (head_block_time() >= HARDFORK_SON2_TIME) && (head_block_time() < HARDFORK_SON3_TIME) ) + return sort_votable_objects(std::max(son_count*2+1, (size_t)get_chain_properties().immutable_parameters.min_son_count)); + else + return sort_votable_objects(get_global_properties().parameters.maximum_son_count()); + }(); const auto& all_sons = get_index_type().indices();