diff options
-rw-r--r-- | README.md | 8 | ||||
-rw-r--r-- | src/wallet/wallet2.cpp | 12 |
2 files changed, 16 insertions, 4 deletions
@@ -272,7 +272,11 @@ See README.i18n ## Using Tor -While Monero isn't made to integrate with Tor, it can be used wrapped with torsocks, if you add --p2p-bind-ip 127.0.0.1 to the monerod command line. You also want to set DNS requests to go over TCP, so they'll be routed through Tor, by setting DNS_PUBLIC=tcp. You may also disable IGD (UPnP port forwarding negotiation), which is pointless with Tor. To allow local connections from the wallet, add TORSOCKS_ALLOW_INBOUND=1. Example: +While Monero isn't made to integrate with Tor, it can be used wrapped with torsocks, if you add --p2p-bind-ip 127.0.0.1 to the monerod command line. You also want to set DNS requests to go over TCP, so they'll be routed through Tor, by setting DNS_PUBLIC=tcp. You may also disable IGD (UPnP port forwarding negotiation), which is pointless with Tor. To allow local connections from the wallet, you might have to add TORSOCKS_ALLOW_INBOUND=1, some OSes need it and some don't. Example: + +`DNS_PUBLIC=tcp torsocks monerod --p2p-bind-ip 127.0.0.1 --no-igd` + +or: `DNS_PUBLIC=tcp TORSOCKS_ALLOW_INBOUND=1 torsocks monerod --p2p-bind-ip 127.0.0.1 --no-igd` @@ -280,7 +284,7 @@ TAILS ships with a very restrictive set of firewall rules. Therefore, you need t `sudo iptables -I OUTPUT 2 -p tcp -d 127.0.0.1 -m tcp --dport 18081 -j ACCEPT` -`DNS_PUBLIC=tcp TORSOCKS_ALLOW_INBOUND=1 torsocks ./monerod --p2p-bind-ip 127.0.0.1 --no-igd --rpc-bind-ip 127.0.0.1 --data-dir /home/amnesia/Persistent/your/directory/to/the/blockchain` +`DNS_PUBLIC=tcp torsocks ./monerod --p2p-bind-ip 127.0.0.1 --no-igd --rpc-bind-ip 127.0.0.1 --data-dir /home/amnesia/Persistent/your/directory/to/the/blockchain` `./monero-wallet-cli` diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index f080f1e0d..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); @@ -3279,6 +3281,9 @@ std::vector<wallet2::pending_tx> wallet2::create_transactions_2(std::vector<cryp } LOG_PRINT_L2("Starting with " << unused_transfers_indices.size() << " non-dust outputs and " << unused_dust_indices.size() << " dust outputs"); + if (unused_dust_indices.empty() && unused_transfers_indices.empty()) + return std::vector<wallet2::pending_tx>(); + // start with an empty tx txes.push_back(TX()); accumulated_fee = 0; @@ -3515,6 +3520,9 @@ std::vector<wallet2::pending_tx> wallet2::create_transactions_all(const cryptono } LOG_PRINT_L2("Starting with " << unused_transfers_indices.size() << " non-dust outputs and " << unused_dust_indices.size() << " dust outputs"); + if (unused_dust_indices.empty() && unused_transfers_indices.empty()) + return std::vector<wallet2::pending_tx>(); + // start with an empty tx txes.push_back(TX()); accumulated_fee = 0; |