diff --git a/libraries/app/database_api.cpp b/libraries/app/database_api.cpp index 447e07ca..b911a284 100644 --- a/libraries/app/database_api.cpp +++ b/libraries/app/database_api.cpp @@ -173,8 +173,7 @@ class database_api_impl : public std::enable_shared_from_this vector get_tournaments_by_state(tournament_id_type stop, unsigned limit, tournament_id_type start, tournament_state state); vector get_registered_tournaments(account_id_type account_filter, uint32_t limit) const; - // gpos - gpos_info get_gpos_info(const account_id_type account) const; + // rng int64_t get_random_number(uint64_t bound) const; //private: @@ -2133,53 +2132,10 @@ vector database_api_impl::get_registered_tournaments(account ////////////////////////////////////////////////////////////////////// // // -// GPOS methods // +// Random numbers // // // ////////////////////////////////////////////////////////////////////// -graphene::app::gpos_info database_api::get_gpos_info(const account_id_type account) const -{ - return my->get_gpos_info(account); - -} -graphene::app::gpos_info database_api_impl::get_gpos_info(const account_id_type account) const -{ - gpos_info result; - result.vesting_factor = _db.calculate_vesting_factor(account(_db)); - - const auto& dividend_data = asset_id_type()(_db).dividend_data(_db); - const account_object& dividend_distribution_account = dividend_data.dividend_distribution_account(_db); - result.award = _db.get_balance(dividend_distribution_account, asset_id_type()(_db)); - - share_type total_amount; - auto balance_type = vesting_balance_type::gpos; -#ifdef USE_VESTING_OBJECT_BY_ASSET_BALANCE_INDEX - // get only once a collection of accounts that hold nonzero vesting balances of the dividend asset - auto vesting_balances_begin = - vesting_index.indices().get().lower_bound(boost::make_tuple(asset_id_type(), balance_type)); - auto vesting_balances_end = - vesting_index.indices().get().upper_bound(boost::make_tuple(asset_id_type(), balance_type, share_type())); - - for (const vesting_balance_object& vesting_balance_obj : boost::make_iterator_range(vesting_balances_begin, vesting_balances_end)) - { - total_amount += vesting_balance_obj.balance.amount; - } -#else - const vesting_balance_index& vesting_index = _db.get_index_type(); - const auto& vesting_balances = vesting_index.indices().get(); - for (const vesting_balance_object& vesting_balance_obj : vesting_balances) - { - if (vesting_balance_obj.balance.asset_id == asset_id_type() && vesting_balance_obj.balance_type == balance_type) - { - total_amount += vesting_balance_obj.balance.amount; - } - } -#endif - - result.total_amount = total_amount; - return result; -} - int64_t database_api::get_random_number(uint64_t bound) const { return my->get_random_number(bound); diff --git a/libraries/app/include/graphene/app/database_api.hpp b/libraries/app/include/graphene/app/database_api.hpp index 8ca9c6b6..8fb7f17a 100644 --- a/libraries/app/include/graphene/app/database_api.hpp +++ b/libraries/app/include/graphene/app/database_api.hpp @@ -667,14 +667,6 @@ class database_api */ vector get_registered_tournaments(account_id_type account_filter, uint32_t limit) const; - ////////// - // GPOS // - ////////// - /** - * @return account and network GPOS information - */ - gpos_info get_gpos_info(const account_id_type account) const; - ////////// // RNG // ////////// @@ -812,9 +804,6 @@ FC_API(graphene::app::database_api, (get_tournaments ) (get_registered_tournaments) - // gpos - (get_gpos_info) - // rngs (get_random_number) )