Cleanup #312
This commit is contained in:
parent
b307557182
commit
38ac7cb457
1 changed files with 48 additions and 53 deletions
|
|
@ -626,7 +626,6 @@ namespace graphene { namespace app {
|
|||
asset_api::~asset_api() { }
|
||||
|
||||
vector<account_asset_balance> asset_api::get_asset_holders( asset_id_type asset_id, uint32_t start, uint32_t limit ) const {
|
||||
|
||||
FC_ASSERT(limit <= 100);
|
||||
|
||||
const auto& bal_idx = _db.get_index_type< account_balance_index >().indices().get< by_asset_balance >();
|
||||
|
|
@ -634,18 +633,19 @@ namespace graphene { namespace app {
|
|||
|
||||
vector<account_asset_balance> result;
|
||||
|
||||
uint32_t total_counter = 0;
|
||||
uint32_t start_counter = 0;
|
||||
|
||||
uint32_t index = 0;
|
||||
for( const account_balance_object& bal : boost::make_iterator_range( range.first, range.second ) )
|
||||
{
|
||||
//wdump((bal));
|
||||
if( bal.balance.value == 0 ) continue;
|
||||
if( result.size() >= limit )
|
||||
break;
|
||||
|
||||
start_counter++;
|
||||
if( start >= start_counter ) continue;
|
||||
if( bal.balance.value == 0 )
|
||||
continue;
|
||||
|
||||
auto account = _db.find(bal.owner);
|
||||
if( index++ < start )
|
||||
continue;
|
||||
|
||||
const auto account = _db.find(bal.owner);
|
||||
|
||||
account_asset_balance aab;
|
||||
aab.name = account->name;
|
||||
|
|
@ -653,11 +653,6 @@ namespace graphene { namespace app {
|
|||
aab.amount = bal.balance.value;
|
||||
|
||||
result.push_back(aab);
|
||||
|
||||
if(total_counter >= limit) break;
|
||||
|
||||
total_counter++;
|
||||
|
||||
}
|
||||
|
||||
return result;
|
||||
|
|
|
|||
Loading…
Reference in a new issue