1
0
Fork 0
forked from lthn/blockchain

fixed asset duplication in balances with custom list

This commit is contained in:
cryptozoidberg 2022-12-15 17:11:55 +01:00
parent 63cdb84b80
commit 5c6de2fddb
No known key found for this signature in database
GPG key ID: 22DEB97A54C6FDEC

View file

@ -3167,25 +3167,27 @@ bool wallet2::balance(std::list<wallet_public::asset_balance_entry>& balances, u
{
asset_descriptor_base asset_info = AUTO_VAL_INIT(asset_info);
//check if asset is whitelisted or customly added
auto it = m_whitelisted_assets.find(item.first);
if (it == m_whitelisted_assets.end())
//check if it custom asset
auto it_cust = custom_assets_local.find(item.first);
if(it_cust == custom_assets_local.end())
{
//check if it custom asset
auto it_cust = custom_assets_local.find(item.first);
if (it_cust == custom_assets_local.end())
auto it_local = m_whitelisted_assets.find(item.first);
if(it_local == m_whitelisted_assets.end())
{
continue;
}
else
else
{
asset_info = it_cust->second;
custom_assets_local.erase(it_cust);
asset_info = it_local->second;
}
}
else
else
{
asset_info = it->second;
}
asset_info = it_cust->second;
custom_assets_local.erase(it_cust);
}
balances.push_back(wallet_public::asset_balance_entry());
wallet_public::asset_balance_entry& new_item = balances.back();
static_cast<wallet_public::asset_balance_entry_base&>(new_item) = item.second;