forked from lthn/blockchain
wallet: fixed/improved: set_tids_to_be_only_used_in_the_next_transfer(), get_transfer_info_by_index(), get_asset_info()
This commit is contained in:
parent
c25641b0e0
commit
935feb66f5
2 changed files with 5 additions and 4 deletions
|
|
@ -223,8 +223,10 @@ bool wallet2::get_transfer_info_by_key_image(const crypto::key_image& ki, transf
|
|||
//----------------------------------------------------------------------------------------------------
|
||||
bool wallet2::get_transfer_info_by_index(size_t i, transfer_details& td)
|
||||
{
|
||||
//WLT_CHECK_AND_ASSERT_MES(i < m_transfers.size(), false, "wrong out in transaction: internal index, m_transfers.size()=" << m_transfers.size());
|
||||
td = m_transfers.at(i);
|
||||
auto it = m_transfers.find(i);
|
||||
if (it == m_transfers.end())
|
||||
return false;
|
||||
td = it->second;
|
||||
return true;
|
||||
}
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
|
|
@ -3865,7 +3867,7 @@ bool wallet2::get_asset_info(const crypto::public_key& asset_id, currency::asset
|
|||
asset_flags |= aif_custom;
|
||||
}
|
||||
|
||||
if (ask_daemon_for_unknown)
|
||||
if (asset_flags == aif_none && ask_daemon_for_unknown)
|
||||
{
|
||||
if (daemon_get_asset_info(asset_id, asset_info))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -588,7 +588,6 @@ namespace tools
|
|||
|
||||
void set_tids_to_be_only_used_in_the_next_transfer(const std::vector<uint64_t>& tids)
|
||||
{
|
||||
WLT_THROW_IF_FALSE_WALLET_CMN_ERR_EX(std::all_of(tids.cbegin(), tids.cend(), [&](size_t i){ return i < m_transfers.size(); }), "some transfers IDs are out of range");
|
||||
m_found_free_amounts.clear();
|
||||
add_transfers_to_transfers_cache(tids);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue