diff options
author | luigi1111 <luigi1111w@gmail.com> | 2022-03-18 16:29:25 -0500 |
---|---|---|
committer | luigi1111 <luigi1111w@gmail.com> | 2022-03-18 16:29:25 -0500 |
commit | 34dd47510a12f4a7c5e28c4f6bf6bd7fa23ce549 (patch) | |
tree | ebf1de24304ad55d05be74579f5c4e959571d58e /src/wallet/wallet2.cpp | |
parent | Merge pull request #8154 (diff) | |
parent | Balance includes unconfirmed transfers to self (diff) | |
download | monero-34dd47510a12f4a7c5e28c4f6bf6bd7fa23ce549.tar.xz |
Merge pull request #8159
fb018df Balance includes unconfirmed transfers to self (woodser)
Diffstat (limited to 'src/wallet/wallet2.cpp')
-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 138d57e67..088612e50 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -6048,6 +6048,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; + } + } } } |