wallet2: keep received amount breakdown consistent

(cherry picked from commit 0810f48a24d44f03b917a2548e1588b7531b0301)
This commit is contained in:
selsta
2026-10-04 18:50:24 -04:00
committed by such-gitea
parent bd0f37cfb3
commit c7acabc641
+7
View File
@@ -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];