mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-11-27 13:23:29 +01:00
Merge pull request #2797
7e387fb1
wallet2: only add a dummy 0 output if there's one output otherwise (moneromooo-monero)
This commit is contained in:
commit
1de386111f
@ -4667,6 +4667,8 @@ void wallet2::transfer_selected_rct(std::vector<cryptonote::tx_destination_entry
|
|||||||
cryptonote::tx_destination_entry change_dts = AUTO_VAL_INIT(change_dts);
|
cryptonote::tx_destination_entry change_dts = AUTO_VAL_INIT(change_dts);
|
||||||
change_dts.amount = found_money - needed_money;
|
change_dts.amount = found_money - needed_money;
|
||||||
if (change_dts.amount == 0)
|
if (change_dts.amount == 0)
|
||||||
|
{
|
||||||
|
if (splitted_dsts.size() == 1)
|
||||||
{
|
{
|
||||||
// If the change is 0, send it to a random address, to avoid confusing
|
// If the change is 0, send it to a random address, to avoid confusing
|
||||||
// the sender with a 0 amount output. We send a 0 amount in order to avoid
|
// the sender with a 0 amount output. We send a 0 amount in order to avoid
|
||||||
@ -4677,12 +4679,14 @@ void wallet2::transfer_selected_rct(std::vector<cryptonote::tx_destination_entry
|
|||||||
dummy.generate();
|
dummy.generate();
|
||||||
change_dts.addr = dummy.get_keys().m_account_address;
|
change_dts.addr = dummy.get_keys().m_account_address;
|
||||||
LOG_PRINT_L2("generated dummy address for 0 change");
|
LOG_PRINT_L2("generated dummy address for 0 change");
|
||||||
|
splitted_dsts.push_back(change_dts);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
change_dts.addr = get_subaddress({subaddr_account, 0});
|
change_dts.addr = get_subaddress({subaddr_account, 0});
|
||||||
}
|
|
||||||
splitted_dsts.push_back(change_dts);
|
splitted_dsts.push_back(change_dts);
|
||||||
|
}
|
||||||
|
|
||||||
crypto::secret_key tx_key;
|
crypto::secret_key tx_key;
|
||||||
std::vector<crypto::secret_key> additional_tx_keys;
|
std::vector<crypto::secret_key> additional_tx_keys;
|
||||||
|
Loading…
Reference in New Issue
Block a user