Skip to content

Commit

Permalink
Merge pull request #623 from steemit/620-api-get-active-witnesses
Browse files Browse the repository at this point in the history
Fix return type of get_active_witnesses()
  • Loading branch information
Michael Vandeberg authored Nov 28, 2016
2 parents 5b8f699 + 0c9da97 commit b8a0337
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
9 changes: 7 additions & 2 deletions libraries/app/database_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1495,9 +1495,14 @@ vector<account_name_type> database_api::get_miner_queue()const {
return result;
}

fc::array< account_name_type, STEEMIT_MAX_WITNESSES > database_api::get_active_witnesses()const {
vector< account_name_type > database_api::get_active_witnesses()const
{
const auto& wso = my->_db.get_witness_schedule_object();
return wso.current_shuffled_witnesses;
size_t n = wso.current_shuffled_witnesses.size();
vector< account_name_type > result(n);
for( size_t i=0; i<n; i++ )
result.push_back( wso.current_shuffled_witnesses[i] );
return result;
}

vector<discussion> database_api::get_discussions_by_author_before_date(
Expand Down
2 changes: 1 addition & 1 deletion libraries/app/include/steemit/app/database_api.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ class database_api
vector<category_api_obj> get_active_categories( string after, uint32_t limit )const;
vector<category_api_obj> get_recent_categories( string after, uint32_t limit )const;

fc::array< account_name_type, STEEMIT_MAX_WITNESSES > get_active_witnesses()const;
vector< account_name_type > get_active_witnesses()const;
vector< account_name_type > get_miner_queue()const;

/////////////////////////////
Expand Down
2 changes: 1 addition & 1 deletion libraries/wallet/include/steemit/wallet/wallet.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class wallet_api
/**
* Returns the list of witnesses producing blocks in the current round (21 Blocks)
*/
fc::array< account_name_type, STEEMIT_MAX_WITNESSES > get_active_witnesses()const;
vector<account_name_type> get_active_witnesses()const;

/**
* Returns the queue of pow miners waiting to produce blocks.
Expand Down
3 changes: 2 additions & 1 deletion libraries/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1032,7 +1032,8 @@ set<string> wallet_api::list_accounts(const string& lowerbound, uint32_t limit)
vector<account_name_type> wallet_api::get_miner_queue()const {
return my->_remote_db->get_miner_queue();
}
fc::array< account_name_type, STEEMIT_MAX_WITNESSES > wallet_api::get_active_witnesses()const {

std::vector< account_name_type > wallet_api::get_active_witnesses()const {
return my->_remote_db->get_active_witnesses();
}

Expand Down

0 comments on commit b8a0337

Please sign in to comment.