diff --git a/libraries/chain/include/graphene/chain/global_property_object.hpp b/libraries/chain/include/graphene/chain/global_property_object.hpp index 7ad34aaa..458ca1c5 100644 --- a/libraries/chain/include/graphene/chain/global_property_object.hpp +++ b/libraries/chain/include/graphene/chain/global_property_object.hpp @@ -52,13 +52,13 @@ namespace graphene { namespace chain { uint32_t next_available_vote_id = 0; vector active_committee_members; // updated once per maintenance interval flat_set active_witnesses; // updated once per maintenance interval - - //! Fixme - delete sidechain type from here flat_map > active_sons = []() // updated once per maintenance interval { flat_map > active_sons; - active_sons[sidechain_type::bitcoin] = vector(); - active_sons[sidechain_type::hive] = vector(); + for(const auto& active_sidechain_type : active_sidechain_types) + { + active_sons[active_sidechain_type] = vector(); + } return active_sons; }(); // n.b. witness scheduling is done by witness_schedule object diff --git a/libraries/chain/include/graphene/chain/sidechain_defs.hpp b/libraries/chain/include/graphene/chain/sidechain_defs.hpp index df2d84cd..1097323b 100644 --- a/libraries/chain/include/graphene/chain/sidechain_defs.hpp +++ b/libraries/chain/include/graphene/chain/sidechain_defs.hpp @@ -1,5 +1,6 @@ #pragma once +#include #include namespace graphene { namespace chain { @@ -13,6 +14,8 @@ enum class sidechain_type { hive }; +static const std::set active_sidechain_types = {sidechain_type::bitcoin, sidechain_type::hive}; + } } FC_REFLECT_ENUM(graphene::chain::sidechain_type, @@ -21,4 +24,4 @@ FC_REFLECT_ENUM(graphene::chain::sidechain_type, (ethereum) (eos) (hive) - (peerplays) ) + (peerplays) ) \ No newline at end of file diff --git a/libraries/chain/include/graphene/chain/son_object.hpp b/libraries/chain/include/graphene/chain/son_object.hpp index a291ca2f..6508ce81 100644 --- a/libraries/chain/include/graphene/chain/son_object.hpp +++ b/libraries/chain/include/graphene/chain/son_object.hpp @@ -71,12 +71,13 @@ namespace graphene { namespace chain { public_key_type signing_key; vesting_balance_id_type pay_vb; son_statistics_id_type statistics; - //! Fixme - delete sidechain type from here flat_map statuses = []() { flat_map statuses; - statuses[sidechain_type::bitcoin] = son_status::inactive; - statuses[sidechain_type::hive] = son_status::inactive; + for(const auto& active_sidechain_type : active_sidechain_types) + { + statuses[active_sidechain_type] = son_status::inactive; + } return statuses; }(); flat_map sidechain_public_keys;