mirror of
https://github.com/wownero/wownero.git
synced 2026-10-17 15:41:44 +02:00
wallet: fix split transaction change address display
Display the first non-zero change address after verifying that all effective change uses the same address. Foreign change is already rejected during signing, so this only fixes misleading display. Reported by xmrack and the MAGIC Monero Fund.
This commit is contained in:
@@ -7592,7 +7592,8 @@ bool simple_wallet::accept_loaded_tx(const std::function<size_t()> get_num_txes,
|
||||
std::string change_string;
|
||||
if (change > 0)
|
||||
{
|
||||
std::string address = get_account_address_as_str(m_wallet->nettype(), get_tx(0).subaddr_account > 0, get_tx(0).change_dts.addr);
|
||||
const tools::wallet2::tx_construction_data &cd = get_tx(first_known_non_zero_change_index);
|
||||
std::string address = get_account_address_as_str(m_wallet->nettype(), cd.subaddr_account > 0, cd.change_dts.addr);
|
||||
change_string += (boost::format(tr("%s change to %s")) % print_money(change) % address).str();
|
||||
}
|
||||
else
|
||||
|
||||
@@ -212,7 +212,8 @@ bool UnsignedTransactionImpl::checkLoadedTx(const std::function<size_t()> get_nu
|
||||
std::string change_string;
|
||||
if (change > 0)
|
||||
{
|
||||
std::string address = get_account_address_as_str(m_wallet.m_wallet->nettype(), get_tx(0).subaddr_account > 0, get_tx(0).change_dts.addr);
|
||||
const tools::wallet2::tx_construction_data &cd = get_tx(first_known_non_zero_change_index);
|
||||
std::string address = get_account_address_as_str(m_wallet.m_wallet->nettype(), cd.subaddr_account > 0, cd.change_dts.addr);
|
||||
change_string += (boost::format(tr("%s change to %s")) % cryptonote::print_money(change) % address).str();
|
||||
}
|
||||
else
|
||||
|
||||
@@ -1638,8 +1638,7 @@ namespace tools
|
||||
|
||||
if (desc.change_amount > 0)
|
||||
{
|
||||
const tools::wallet2::tx_construction_data &cd0 = tx_constructions[0];
|
||||
desc.change_address = get_account_address_as_str(m_wallet->nettype(), cd0.subaddr_account > 0, cd0.change_dts.addr);
|
||||
desc.change_address = get_account_address_as_str(m_wallet->nettype(), cd.subaddr_account > 0, cd.change_dts.addr);
|
||||
res.summary.change_address = desc.change_address;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user