0 Members and 1 Guest are viewing this topic.
vector<pair<account_id_type, share_type>> database::get_balance(asset_id_type asset_id) const{ vector<pair<account_id_type, share_type>> results; pair<account_id_type, share_type> result; auto& index = get_index_type<account_balance_index>().indices().get<by_asset>(); for (auto itr = index.find(asset_id); itr != index.end() && itr->asset_type == asset_id; itr++) { result.first = itr->owner; result.second = itr->balance; results.push_back(result); } return results;}
now .. this is very useful for sharedrops and alike:https://github.com/pureland/bitshares-2/commit/106b195838943801871ed9e74c0a9f6269738bc8could you add a cli-wallet call to get the owners and their balances for a given asset? that would be awesome!We need a worker for this, so we can pay CNX to properly review this code!!
dividend k1 DVD BTS 10000 188 0 testing 1{ "ref_block_num": 924, "ref_block_prefix": 480314239, "expiration": "2016-02-15T15:18:20", "operations": [[ 45,{ "fee": { "amount": 20007812, "asset_id": "1.3.0" }, "isser": "1.2.11", "shares_asset": "1.3.1", "dividend_asset": "1.3.0", "min_shares": 10000, "value_per_shares": 188, "block_no": 0, "describtion": "testing", "extensions": [] } ] ], "extensions": [], "signatures": [ "1f1782d8f8b74eb711764731855a457aefcdee04d31048915445575871a4e2782a66f6da6e10d68c15245fc6a84b976fc4bf21a36d8177e4ae2c2d90ba6eef0664" ]}