fix code style

This commit is contained in:
gladcow 2019-11-11 12:54:54 +03:00
parent 8c4eb579a7
commit 62f973ca80

View file

@ -1934,28 +1934,26 @@ public:
map<string, son_id_type> list_active_sons() map<string, son_id_type> list_active_sons()
{ try { { try {
global_property_object gpo = get_global_properties(); global_property_object gpo = get_global_properties();
std::vector<fc::optional<son_object>> son_objects = std::vector<fc::optional<son_object>> son_objects = _remote_db->get_sons(gpo.active_sons);
_remote_db->get_sons(gpo.active_sons); vector<account_id_type> owners;
vector<account_id_type> owners; owners.resize(son_objects.size());
owners.resize(son_objects.size()); std::transform(son_objects.begin(), son_objects.end(), owners.begin(),
std::transform(son_objects.begin(), son_objects.end(), owners.begin(), [](const fc::optional<son_object>& obj) {
[](const fc::optional<son_object>& obj) { if(!obj)
if(!obj) FC_THROW("Invalid active SONs list in global properties.");
FC_THROW("Invalid active SONs list in global properties."); return obj->son_account;
return obj->son_account; });
}); vector<fc::optional<account_object>> accs = _remote_db->get_accounts(owners);
vector<fc::optional<account_object>> accs = _remote_db->get_accounts(owners); map<string, son_id_type> result;
map<string, son_id_type> result; std::transform(accs.begin(), accs.end(), gpo.active_sons.begin(),
std::transform(accs.begin(), accs.end(), gpo.active_sons.begin(), std::inserter(result, result.end()),
std::inserter(result, result.end()), [](fc::optional<account_object>& acct, son_id_type& sid) {
[](fc::optional<account_object>& acct, if(!acct)
son_id_type& sid) { FC_THROW("Invalid active SONs list in global properties.");
if(!acct) return std::make_pair<string, son_id_type>(string(acct->name), std::move(sid));
FC_THROW("Invalid active SONs list in global properties."); });
return std::make_pair<string, son_id_type>(string(acct->name), std::move(sid)); return result;
});
return result;
} FC_CAPTURE_AND_RETHROW() } } FC_CAPTURE_AND_RETHROW() }
signed_transaction create_witness(string owner_account, signed_transaction create_witness(string owner_account,