Skip to content

Commit

Permalink
Merge pull request #278 from loki-project/dev
Browse files Browse the repository at this point in the history
Merge subaddresses sanity check fix from dev
  • Loading branch information
Doy-lee authored Oct 1, 2018
2 parents 7ebbb5a + 15a254d commit ce87445
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/wallet/wallet2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1523,10 +1523,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->index.major == *subaddr_account)
{
sub_change += i->amount;
i = tx_money_got_in_outs.erase(i);
}
else
++i;
}
Expand Down Expand Up @@ -1573,7 +1577,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.amount;

Expand Down

0 comments on commit ce87445

Please sign in to comment.