wallet2: reuse fake outs when adjusting fee on transfer

This avoids indirectly leaking the real output to the daemon,
and is faster.

This will still happen for more complex cases, especially
when cancelling a tx and "re-rolling" it.
This commit is contained in:
moneromooo-monero 2017-01-07 16:06:07 +00:00
parent 64da0983d5
commit d86ae2bec6
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3
3 changed files with 55 additions and 23 deletions

View file

@ -396,6 +396,7 @@ namespace tools
std::vector<cryptonote::tx_destination_entry> dsts;
std::vector<uint8_t> extra;
LOG_PRINT_L3("on_transfer_split starts");
if (m_wallet.restricted())
{
er.code = WALLET_RPC_ERROR_CODE_DENIED;
@ -485,9 +486,13 @@ namespace tools
mixin = 2;
}
std::vector<wallet2::pending_tx> ptx_vector;
LOG_PRINT_L2("on_transfer_split calling create_transactions_2");
ptx_vector = m_wallet.create_transactions_2(dsts, mixin, req.unlock_time, req.priority, extra, req.trusted_daemon);
LOG_PRINT_L2("on_transfer_split called create_transactions_2");
LOG_PRINT_L2("on_transfer_split calling commit_txyy");
m_wallet.commit_tx(ptx_vector);
LOG_PRINT_L2("on_transfer_split called commit_txyy");
// populate response with tx hashes
for (auto & ptx : ptx_vector)