Display up to 15 active SONs, SON ordering by total_votes
This commit is contained in:
parent
0ca2336dc1
commit
b53d3f2df1
3 changed files with 5 additions and 7 deletions
|
|
@ -393,10 +393,12 @@ void database::update_active_sons()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const chain_property_object& cpo = get_chain_properties();
|
//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));
|
//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 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();
|
const auto& all_sons = get_index_type<son_index>().indices();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -51,9 +51,7 @@ namespace graphene { namespace chain {
|
||||||
uint32_t next_available_vote_id = 0;
|
uint32_t next_available_vote_id = 0;
|
||||||
vector<committee_member_id_type> active_committee_members; // updated once per maintenance interval
|
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
|
flat_set<witness_id_type> active_witnesses; // updated once per maintenance interval
|
||||||
// n.b. witness scheduling is done by witness_schedule object
|
vector<son_id_type> active_sons; // updated once per maintenance interval
|
||||||
|
|
||||||
flat_set<son_id_type> active_sons; // updated once per maintenance interval
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -1361,9 +1361,7 @@ BOOST_FIXTURE_TEST_CASE( select_top_fifteen_sons, cli_fixture )
|
||||||
BOOST_TEST_MESSAGE("gpo: " << gpo.active_sons.size());
|
BOOST_TEST_MESSAGE("gpo: " << gpo.active_sons.size());
|
||||||
BOOST_CHECK(generate_maintenance_block(app1));
|
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() == 15);
|
||||||
BOOST_CHECK(gpo.active_sons.size() == 0);
|
|
||||||
|
|
||||||
} catch( fc::exception& e ) {
|
} catch( fc::exception& e ) {
|
||||||
BOOST_TEST_MESSAGE("SON cli wallet tests exception");
|
BOOST_TEST_MESSAGE("SON cli wallet tests exception");
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue