diff options
author | Riccardo Spagni <ric@spagni.net> | 2018-09-29 22:17:21 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2018-09-29 22:20:41 +0200 |
commit | 4a2664f743bcbfe47b15e20c22c966a54f91090e (patch) | |
tree | c336fd3b83653e672ca4077cfc550f236b5bfa45 /src/wallet/wallet2.cpp | |
parent | Merge pull request #4459 (diff) | |
download | monero-4a2664f743bcbfe47b15e20c22c966a54f91090e.tar.xz |
Merge pull request #4461
7dd11711 wallet2: fix transfers between subaddresses hitting the sanity check (moneromooo-monero)
Diffstat (limited to 'src/wallet/wallet2.cpp')
-rw-r--r-- | src/wallet/wallet2.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index 95474ce34..a60874af9 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) |