wallet2: take ignored-by-value outputs into account in balance

This commit is contained in:
Crypto City 2023-06-10 06:39:37 +00:00 committed by moneromooo-monero
parent 94e67bf96b
commit c138a28f51
No known key found for this signature in database
GPG Key ID: 686F07454D6CEFC3
1 changed files with 4 additions and 0 deletions

View File

@ -6091,6 +6091,8 @@ std::map<uint32_t, uint64_t> wallet2::balance_per_subaddress(uint32_t index_majo
std::map<uint32_t, uint64_t> amount_per_subaddr; std::map<uint32_t, uint64_t> amount_per_subaddr;
for (const auto& td: m_transfers) for (const auto& td: m_transfers)
{ {
if (td.amount() > m_ignore_outputs_above || td.amount() < m_ignore_outputs_below)
continue;
if (td.m_subaddr_index.major == index_major && !is_spent(td, strict) && !td.m_frozen) if (td.m_subaddr_index.major == index_major && !is_spent(td, strict) && !td.m_frozen)
{ {
auto found = amount_per_subaddr.find(td.m_subaddr_index.minor); auto found = amount_per_subaddr.find(td.m_subaddr_index.minor);
@ -6146,6 +6148,8 @@ std::map<uint32_t, std::pair<uint64_t, std::pair<uint64_t, uint64_t>>> wallet2::
const uint64_t now = time(NULL); const uint64_t now = time(NULL);
for(const transfer_details& td: m_transfers) for(const transfer_details& td: m_transfers)
{ {
if (td.amount() > m_ignore_outputs_above || td.amount() < m_ignore_outputs_below)
continue;
if(td.m_subaddr_index.major == index_major && !is_spent(td, strict) && !td.m_frozen) if(td.m_subaddr_index.major == index_major && !is_spent(td, strict) && !td.m_frozen)
{ {
uint64_t amount = 0, blocks_to_unlock = 0, time_to_unlock = 0; uint64_t amount = 0, blocks_to_unlock = 0, time_to_unlock = 0;