diff options
| author | Riccardo Spagni <ric@spagni.net> | 2016-09-18 17:42:31 +0200 |
|---|---|---|
| committer | Riccardo Spagni <ric@spagni.net> | 2016-09-18 17:42:32 +0200 |
| commit | 6b744c349fe52b9034a146507fc1e78df50c1f90 (patch) | |
| tree | bd37ace18e610bb8dcc4259feb6e6130b16243ec /src | |
| parent | a6914c140c2b4573da4567374aa8156fddd6debd (diff) | |
| parent | 1dd5b0b7dff60d45aa3d5d33f8be304f3e222c7a (diff) | |
| download | monzero-core-6b744c349fe52b9034a146507fc1e78df50c1f90.tar.gz monzero-core-6b744c349fe52b9034a146507fc1e78df50c1f90.tar.xz monzero-core-6b744c349fe52b9034a146507fc1e78df50c1f90.zip | |
Merge pull request #1098
1dd5b0b wallet: keep change dest separate from other dests (moneromooo-monero)
Diffstat (limited to 'src')
| -rw-r--r-- | src/wallet/wallet2.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index 02f8ae535..3d4f93aff 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -3063,16 +3063,18 @@ void wallet2::transfer_selected_rct(std::vector<cryptonote::tx_destination_entry ++out_index; } + // we still keep a copy, since we want to keep dsts free of change for user feedback purposes + std::vector<cryptonote::tx_destination_entry> splitted_dsts = dsts; cryptonote::tx_destination_entry change_dts = AUTO_VAL_INIT(change_dts); if (needed_money < found_money) { change_dts.addr = m_account.get_keys().m_account_address; change_dts.amount = found_money - needed_money; - dsts.push_back(change_dts); + splitted_dsts.push_back(change_dts); } crypto::secret_key tx_key; - bool r = cryptonote::construct_tx_and_get_tx_key(m_account.get_keys(), sources, dsts, extra, tx, unlock_time, tx_key, true); + bool r = cryptonote::construct_tx_and_get_tx_key(m_account.get_keys(), sources, splitted_dsts, extra, tx, unlock_time, tx_key, true); THROW_WALLET_EXCEPTION_IF(!r, error::tx_not_constructed, sources, dsts, unlock_time, m_testnet); THROW_WALLET_EXCEPTION_IF(upper_transaction_size_limit <= get_object_blobsize(tx), error::tx_too_big, tx, upper_transaction_size_limit); |
