mirror of
https://github.com/monero-project/monero.git
synced 2024-10-01 11:49:47 -04:00
wallet2: fix transfers between subaddresses hitting the sanity check
Transfers between subaddresses are accounted for differently
This commit is contained in:
parent
c6ce8235d8
commit
1f8bfe7ffa
@ -1455,10 +1455,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;
|
||||
}
|
||||
@ -1505,7 +1509,7 @@ void wallet2::process_new_transaction(const crypto::hash &txid, const cryptonote
|
||||
LOG_PRINT_L2("Found unencrypted payment ID: " << payment_id);
|
||||
}
|
||||
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user