diff options
-rw-r--r-- | CMakeLists.txt | 26 | ||||
-rw-r--r-- | README.md | 8 | ||||
-rw-r--r-- | src/wallet/wallet2.cpp | 12 | ||||
-rw-r--r-- | utils/gpg_keys/moneromooo.asc | 50 |
4 files changed, 63 insertions, 33 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 2761b32f7..9f15c73dc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -330,6 +330,7 @@ if(MSVC) endif() include_directories(SYSTEM src/platform/msc) else() + include(TestCXXAcceptsFlag) set(ARCH native CACHE STRING "CPU to build for: -march value or 'default' to not pass -march at all") message(STATUS "Building on ${CMAKE_SYSTEM_PROCESSOR} for ${ARCH}") if(ARCH STREQUAL "default") @@ -391,15 +392,32 @@ else() message(STATUS "AES support enabled") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -maes") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -maes") - elseif(ARM) #NB ARMv8 DOES support AES, but not yet coded - message(STATUS "AES support disabled (not available on ARM)") + elseif(ARM6) + message(STATUS "AES support not available on ARMv6") + elseif(ARM7) + message(STATUS "AES support not available on ARMv7") + elseif(ARM8) + CHECK_CXX_ACCEPTS_FLAG("-march=${ARCH}+crypto" ARCH_PLUS_CRYPTO) + if(ARCH_PLUS_CRYPTO) + message(STATUS "Crypto extensions enabled for ARMv8") + set(ARCH_FLAG "-march=${ARCH}+crypto") + else() + message(STATUS "Crypto extensions unavailable on your ARMv8 device") + endif() else() message(STATUS "AES support disabled") endif() + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 -D_GNU_SOURCE ${MINGW_FLAG} ${STATIC_ASSERT_FLAG} ${WARNINGS} ${C_WARNINGS} ${ARCH_FLAG} ${COVERAGE_FLAGS}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -D_GNU_SOURCE ${MINGW_FLAG} ${WARNINGS} ${CXX_WARNINGS} ${ARCH_FLAG} ${COVERAGE_FLAGS}") + + # With GCC 6.1.1 the compiled binary malfunctions due to aliasing. Until that + # is fixed in the code (Issue #847), force compiler to be conservative. + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-strict-aliasing") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing") + if(ARM) message(STATUS "Setting FPU Flags for ARM Processors") - include(TestCXXAcceptsFlag) #NB NEON hardware does not fully implement the IEEE 754 standard for floating-point arithmetic #Need custom assembly code to take full advantage of NEON SIMD @@ -407,7 +425,7 @@ else() #Cortex-A5/9 -mfpu=neon-fp16 #Cortex-A7/15 -mfpu=neon-vfpv4 #Cortex-A8 -mfpu=neon - #ARMv8 -FP and SIMD on by default for all ARM8v-a series, NO -mfpu setting needed + #ARMv8 -FP and SIMD on by default for all ARM8v-A series, NO -mfpu setting needed #For custom -mtune, processor IDs for ARMv8-A series: #0xd04 - Cortex-A35 @@ -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; diff --git a/utils/gpg_keys/moneromooo.asc b/utils/gpg_keys/moneromooo.asc index e30809608..86a4a21b4 100644 --- a/utils/gpg_keys/moneromooo.asc +++ b/utils/gpg_keys/moneromooo.asc @@ -14,18 +14,18 @@ p7gDvxXOGxzq0sqfPTWTBdCj1OPfunHbbeH8ypwBlNpwVG40fJdya+Dqjwu25qX6 Xh5vxLzeJTBmlawa97MCliPvzzJgW9qHRVCa9lLloGVYLiUOS0N+dZ/r/QARAQAB tD5tb25lcm9tb29vLW1vbmVybyA8bW9uZXJvbW9vby1tb25lcm9AdXNlcnMubm9y ZXBseS5naXRodWIuY29tPokCPwQTAQIAKQIbAwcLCQgHAwIBBhUIAgkKCwQWAgMB -Ah4BAheABQJWERAMBQkFoNuFAAoJEGhvB0VNbO/DhEcP/2+CnIe4k+WPknVPDcfU -45eryg/mzTFbgzYxbIDfoILtWLziKJFMap5VxNgN/679UQPZihukVnSnhb2C5Osz -j8hZ8zKLb579xVJbHqrBunykGEpchcUc7/wKwSkBPyJOFluDj/FL43o3fiPgnkls -6vAP143LoLP9QSQfi2LzpnuDrxZ4kDPChL5TytqHtbQjwcYPgfKiJrE2J9jFk5fS -/QCthaE7SkxOUQneL6CCdL95r07SVnN0dldOgOJPmSpo5vmATL5nmb4AyRwyjdsP -TwvwYC0QufvP5P+bPXN7WxVMETwZf5NMpqAoxySDE4kiO7jZ7XZBjn/6NPDSl6r7 -lbTMl7ghrBEmjXOBREE6K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