Skip to content

Commit

Permalink
Fix get_state( "witnesses" ) and witness schedule in state object ste…
Browse files Browse the repository at this point in the history
  • Loading branch information
mvandeberg committed Feb 16, 2018
1 parent b767197 commit 5df1bbe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 18 deletions.
20 changes: 4 additions & 16 deletions libraries/plugins/apis/condenser_api/condenser_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -388,22 +388,10 @@ namespace detail
}
else if( part[0] == "witnesses" || part[0] == "~witnesses")
{
auto start = _database_api->list_witnesses( { { "" }, 1, database_api::by_name } );
if( BOOST_LIKELY( start.witnesses.size() ) )
auto wits = get_witnesses_by_vote( (vector< fc::variant >){ fc::variant(""), fc::variant(50) } );
for( const auto& w : wits )
{
vector< variant > start_key;
start_key.push_back( fc::variant( start.witnesses[0].votes ) );
start_key.push_back( fc::variant( start.witnesses[0].owner ) );
auto wits = _database_api->list_witnesses(
{ fc::variant( start_key ), 50, database_api::by_vote_name } ).witnesses;
//auto wits = get_witnesses_by_vote( "", 50 );
for( const auto& w : wits )
{
_state.witnesses[w.owner] = w;
}
_state.witnesses[w.owner] = w;
}
}
else if( part[0] == "trending" )
Expand Down Expand Up @@ -682,7 +670,7 @@ namespace detail
}
}
_state.witness_schedule = _db.get_witness_schedule_object();
_state.witness_schedule = _database_api->get_witness_schedule( {} );
}
catch ( const fc::exception& e )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -722,8 +722,8 @@ struct state
map< string, discussion > content;
map< string, extended_account > accounts;

map< string, database_api::api_witness_object > witnesses;
database_api::api_witness_schedule_object witness_schedule;
map< string, api_witness_object > witnesses;
api_witness_schedule_object witness_schedule;
legacy_price feed_price;
string error;
};
Expand Down

0 comments on commit 5df1bbe

Please sign in to comment.