Display up to 15 active SONs, SON ordering by total_votes

This commit is contained in:
Srdjan Obucina 2019-10-19 00:11:37 +02:00
parent 0ca2336dc1
commit b53d3f2df1
3 changed files with 5 additions and 7 deletions

View file

@ -393,10 +393,12 @@ void database::update_active_sons()
}
}
const chain_property_object& cpo = get_chain_properties();
auto sons = sort_votable_objects<son_index>(std::max(son_count*2+1, (size_t)cpo.immutable_parameters.min_son_count));
//const chain_property_object& cpo = get_chain_properties();
//auto sons = sort_votable_objects<son_index>(std::max(son_count*2+1, (size_t)cpo.immutable_parameters.min_son_count));
const global_property_object& gpo = get_global_properties();
const chain_parameters& cp = gpo.parameters;
auto sons = sort_votable_objects<son_index>(cp.maximum_son_count);
const auto& all_sons = get_index_type<son_index>().indices();

View file

@ -51,9 +51,7 @@ namespace graphene { namespace chain {
uint32_t next_available_vote_id = 0;
vector<committee_member_id_type> active_committee_members; // updated once per maintenance interval
flat_set<witness_id_type> active_witnesses; // updated once per maintenance interval
// n.b. witness scheduling is done by witness_schedule object
flat_set<son_id_type> active_sons; // updated once per maintenance interval
vector<son_id_type> active_sons; // updated once per maintenance interval
};
/**

View file

@ -1361,9 +1361,7 @@ BOOST_FIXTURE_TEST_CASE( select_top_fifteen_sons, cli_fixture )
BOOST_TEST_MESSAGE("gpo: " << gpo.active_sons.size());
BOOST_CHECK(generate_maintenance_block(app1));
BOOST_CHECK(gpo.active_sons.size() == 16);
BOOST_CHECK(gpo.active_sons.size() == 15);
BOOST_CHECK(gpo.active_sons.size() == 0);
} catch( fc::exception& e ) {
BOOST_TEST_MESSAGE("SON cli wallet tests exception");