mirror of
https://github.com/wownero/wownero.git
synced 2026-10-17 07:31:35 +02:00
wallet2: keep received amount breakdown consistent
(cherry picked from commit 0810f48a24d44f03b917a2548e1588b7531b0301)
This commit is contained in:
@@ -2649,6 +2649,13 @@ void wallet2::process_new_transaction(const crypto::hash &txid, const cryptonote
|
||||
uint64_t amount = tx.vout[o].amount ? tx.vout[o].amount : tx_scan_info[o].amount;
|
||||
uint64_t burnt = m_transfers[kit->second].amount();
|
||||
uint64_t extra_amount = amount - burnt;
|
||||
|
||||
amounts_container& tx_amounts_this_out = tx_amounts_individual_outs[tx_scan_info[o].received->index];
|
||||
auto amount_iterator = std::find(tx_amounts_this_out.begin(), tx_amounts_this_out.end(), amount);
|
||||
THROW_WALLET_EXCEPTION_IF(amount_iterator == tx_amounts_this_out.end(),
|
||||
error::wallet_internal_error, "Unexpected values of new and old outputs");
|
||||
*amount_iterator = extra_amount;
|
||||
|
||||
if (!pool)
|
||||
{
|
||||
transfer_details &td = m_transfers[kit->second];
|
||||
|
||||
Reference in New Issue
Block a user