From 3a968332e8c2922b5d14737ecf422b3a77ddda5e Mon Sep 17 00:00:00 2001 From: theoreticalbts Date: Tue, 9 Feb 2016 04:06:01 -0500 Subject: [PATCH] Remove active_witnesses from global_property_object #562 --- libraries/chain/db_init.cpp | 1 - libraries/chain/db_maint.cpp | 7 ------- .../include/graphene/chain/global_property_object.hpp | 1 - tests/tests/operation_tests.cpp | 5 +++-- 4 files changed, 3 insertions(+), 11 deletions(-) diff --git a/libraries/chain/db_init.cpp b/libraries/chain/db_init.cpp index ba2d07a6..2bb10b30 100644 --- a/libraries/chain/db_init.cpp +++ b/libraries/chain/db_init.cpp @@ -636,7 +636,6 @@ void database::init_genesis(const genesis_state_type& genesis_state) for( uint32_t i = 1; i <= genesis_state.initial_active_witnesses; ++i ) { p.active_witnesses.insert(i); - p.witness_accounts.insert(get(witness_id_type(i)).witness_account); } }); diff --git a/libraries/chain/db_maint.cpp b/libraries/chain/db_maint.cpp index 807254a9..8403f181 100644 --- a/libraries/chain/db_maint.cpp +++ b/libraries/chain/db_maint.cpp @@ -213,13 +213,6 @@ void database::update_active_witnesses() [](const witness_object& w) { return w.id; }); - gp.witness_accounts.clear(); - gp.witness_accounts.reserve(wits.size()); - std::transform(wits.begin(), wits.end(), - std::inserter(gp.witness_accounts, gp.witness_accounts.end()), - [](const witness_object& w) { - return w.witness_account; - }); }); } FC_CAPTURE_AND_RETHROW() } diff --git a/libraries/chain/include/graphene/chain/global_property_object.hpp b/libraries/chain/include/graphene/chain/global_property_object.hpp index 61aecf97..6374b548 100644 --- a/libraries/chain/include/graphene/chain/global_property_object.hpp +++ b/libraries/chain/include/graphene/chain/global_property_object.hpp @@ -49,7 +49,6 @@ namespace graphene { namespace chain { vector active_committee_members; // updated once per maintenance interval flat_set active_witnesses; // updated once per maintenance interval // n.b. witness scheduling is done by witness_schedule object - flat_set witness_accounts; // updated once per maintenance interval }; /** diff --git a/tests/tests/operation_tests.cpp b/tests/tests/operation_tests.cpp index b85b3161..15f7e845 100644 --- a/tests/tests/operation_tests.cpp +++ b/tests/tests/operation_tests.cpp @@ -1137,8 +1137,9 @@ BOOST_AUTO_TEST_CASE( witness_feeds ) generate_block(); const asset_object& bit_usd = get_asset("USDBIT"); auto& global_props = db.get_global_properties(); - const vector active_witnesses(global_props.witness_accounts.begin(), - global_props.witness_accounts.end()); + vector active_witnesses; + for( const witness_id_type& wit_id : global_props.active_witnesses ) + active_witnesses.push_back( wit_id(db).witness_account ); BOOST_REQUIRE_EQUAL(active_witnesses.size(), 10); asset_publish_feed_operation op;