163-fix, Return only non-zero vesting balances

This commit is contained in:
pbattu123 2019-10-03 22:22:21 -03:00
parent f1eb625df8
commit c73d0a338a

View file

@ -935,7 +935,8 @@ vector<vesting_balance_object> database_api_impl::get_vesting_balances( account_
auto vesting_range = _db.get_index_type<vesting_balance_index>().indices().get<by_account>().equal_range(account_id);
std::for_each(vesting_range.first, vesting_range.second,
[&result](const vesting_balance_object& balance) {
result.emplace_back(balance);
if(balance.balance.amount > 0)
result.emplace_back(balance);
});
return result;
}