#339 refactor sidechain type #677

Merged
vampik merged 27 commits from feature/339-refactor-sidechain_type into feature/son-for-hive-voting 2022-04-12 16:39:05 +00:00
Showing only changes of commit ac3e16aca0 - Show all commits

View file

@ -724,12 +724,12 @@ void database::update_active_sons()
const global_property_object& gpo = get_global_properties();
const chain_parameters& cp = gpo.parameters;
//! Fixme - sort_votable_objects - fix bitcoin + hive -> deduce auto
flat_map<sidechain_type, vector<std::reference_wrapper<const son_object> > > sons;
sons[sidechain_type::bitcoin] = sort_votable_objects<son_index>(sidechain_type::bitcoin, cp.maximum_son_count());
sons[sidechain_type::hive] = sort_votable_objects<son_index>(sidechain_type::hive, cp.maximum_son_count());
const auto& all_sons = get_index_type<son_index>().indices();
flat_map<sidechain_type, vector<std::reference_wrapper<const son_object> > > sons;
for(const auto& active_sidechain_type : active_sidechain_types)
{
sons[active_sidechain_type] = sort_votable_objects<son_index>(active_sidechain_type, cp.maximum_son_count());
}
auto& local_vote_buffer_ref = _vote_tally_buffer;
for( const son_object& son : all_sons )