diff options
author | luigi1111 <luigi1111w@gmail.com> | 2022-03-18 16:28:16 -0500 |
---|---|---|
committer | luigi1111 <luigi1111w@gmail.com> | 2022-03-18 16:28:16 -0500 |
commit | d9e6baac421254988ea8a5b23e19aa7aec322658 (patch) | |
tree | 37f4a9b6dd7278e7e17cbe6cecfe5e60f96e0325 /src | |
parent | Merge pull request #7675 (diff) | |
parent | Balance includes unconfirmed transfers to self (diff) | |
download | monero-d9e6baac421254988ea8a5b23e19aa7aec322658.tar.xz |
Merge pull request #8158
e5000a9 Balance includes unconfirmed transfers to self (woodser)
Diffstat (limited to 'src')
-rw-r--r-- | src/wallet/wallet2.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index e95e53e0c..9e95a26c1 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -5833,6 +5833,19 @@ std::map<uint32_t, uint64_t> wallet2::balance_per_subaddress(uint32_t index_majo amount_per_subaddr[0] = utx.second.m_change; else found->second += utx.second.m_change; + + // add transfers to same wallet + for (const auto &dest: utx.second.m_dests) { + auto index = get_subaddress_index(dest.addr); + if (index && (*index).major == index_major) + { + auto found = amount_per_subaddr.find((*index).minor); + if (found == amount_per_subaddr.end()) + amount_per_subaddr[(*index).minor] = dest.amount; + else + found->second += dest.amount; + } + } } } |