Skip to content

Commit

Permalink
Fix list_active_son command output on deregistered SONs
Browse files Browse the repository at this point in the history
  • Loading branch information
serkixenos authored and nathanielhourt committed Feb 8, 2022
1 parent dcdf406 commit 8c402d2
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions libraries/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2210,11 +2210,8 @@ class wallet_api_impl
vector<std::string> owners;
for(auto obj: son_objects)
{
if (obj)
{
std::string acc_id = account_id_to_string(obj->son_account);
owners.push_back(acc_id);
}
std::string acc_id = account_id_to_string(obj->son_account);
owners.push_back(acc_id);
}
vector< optional< account_object> > accs = _remote_db->get_accounts(owners);
std::remove_if(son_objects.begin(), son_objects.end(),
Expand All @@ -2224,9 +2221,7 @@ class wallet_api_impl
std::inserter(result, result.end()),
[](fc::optional<account_object>& acct, fc::optional<son_object> son) {
FC_ASSERT(acct, "Invalid active SONs list in global properties.");
if (son.valid() && son->status != son_status::deregistered)
return std::make_pair<string, son_id_type>(string(acct->name), std::move(son->id));
return std::make_pair<string, son_id_type>(string(acct->name), std::move(son_id_type()));
return std::make_pair<string, son_id_type>(string(acct->name), std::move(son->id));
});
return result;
} FC_CAPTURE_AND_RETHROW() }
Expand Down

0 comments on commit 8c402d2

Please sign in to comment.