aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet2.cpp
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-09-28 10:17:17 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-09-28 10:41:17 +0000
commit7dd11711b03728007d1aa6069b2bb21b21de74a9 (patch)
tree7b04c632404484311ff7a2a3610a258035f92182 /src/wallet/wallet2.cpp
parentMerge pull request #4423 (diff)
downloadmonero-7dd11711b03728007d1aa6069b2bb21b21de74a9.tar.xz
wallet2: fix transfers between subaddresses hitting the sanity check
Transfers between subaddresses are accounted for differently
Diffstat (limited to 'src/wallet/wallet2.cpp')
-rw-r--r--src/wallet/wallet2.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp
index 75178845a..2c27688b0 100644
--- a/src/wallet/wallet2.cpp
+++ b/src/wallet/wallet2.cpp
@@ -1707,10 +1707,14 @@ void wallet2::process_new_transaction(const crypto::hash &txid, const cryptonote
}
// remove change sent to the spending subaddress account from the list of received funds
+ uint64_t sub_change = 0;
for (auto i = tx_money_got_in_outs.begin(); i != tx_money_got_in_outs.end();)
{
if (subaddr_account && i->first.major == *subaddr_account)
+ {
+ sub_change += i->second;
i = tx_money_got_in_outs.erase(i);
+ }
else
++i;
}
@@ -1755,7 +1759,7 @@ void wallet2::process_new_transaction(const crypto::hash &txid, const cryptonote
}
}
- uint64_t total_received_2 = 0;
+ uint64_t total_received_2 = sub_change;
for (const auto& i : tx_money_got_in_outs)
total_received_2 += i.second;
if (total_received_1 != total_received_2)