Page MenuHomePhabricator

[backport#13756] wallet: avoid reuse flags
ClosedPublic

Authored by majcosta on Jun 4 2020, 14:55.

Details

Reviewers
deadalnix
Group Reviewers
Restricted Project
Commits
rABC71e5ab2112db: [backport#13756] wallet: avoid reuse flags
Summary

Add m_avoid_address_reuse flag to coin control object.
Add avoid_reuse wallet flag and accompanying strings/caveats.

https://github.com/bitcoin/bitcoin/pull/13756/commits/eec15662fad917b169f5e3b8baaf4301dcf00a7b


Depends on D6369

Partial backport of Core PR13756

Test Plan
ninja

Event Timeline

majcosta requested review of this revision.Jun 4 2020, 14:55

[Bot Message]
One or more PR numbers were detected in the summary.
Links to those PRs have been inserted into the summary for reference.

Snippet of first build failure:

[14:57:01] :	 [Step 1/2] [304/459] Building C object src/secp256k1/CMakeFiles/recover-bench.dir/src/bench_recover.c.o
[14:57:01] :	 [Step 1/2] [305/459] Building CXX object src/CMakeFiles/server.dir/txmempool.cpp.o
[14:57:01] :	 [Step 1/2] [306/459] Building C object src/secp256k1/CMakeFiles/verify-bench.dir/src/bench_verify.c.o
[14:57:01] :	 [Step 1/2] [307/459] Building CXX object src/CMakeFiles/server.dir/validationinterface.cpp.o
[14:57:01] :	 [Step 1/2] [308/459] Building CXX object src/CMakeFiles/bitcoin-tx.dir/bitcoin-tx.cpp.o
[14:57:01] :	 [Step 1/2] [309/459] Building CXX object src/CMakeFiles/server.dir/validation.cpp.o
[14:57:01] :	 [Step 1/2] [310/459] Building CXX object src/wallet/CMakeFiles/wallet.dir/coinselection.cpp.o
[14:57:01] :	 [Step 1/2] [311/459] Building CXX object src/wallet/CMakeFiles/wallet.dir/crypter.cpp.o
[14:57:01] :	 [Step 1/2] [312/459] Building CXX object src/wallet/CMakeFiles/wallet.dir/db.cpp.o
[14:57:02] :	 [Step 1/2] [313/459] Building C object src/secp256k1/CMakeFiles/internal-bench.dir/src/bench_internal.c.o
[14:57:02] :	 [Step 1/2] [314/459] Building C object src/secp256k1/CMakeFiles/ecmult-bench.dir/src/bench_ecmult.c.o
[14:57:02] :	 [Step 1/2] [315/459] Building C object src/secp256k1/CMakeFiles/secp256k1.dir/src/secp256k1.c.o
[14:57:02] :	 [Step 1/2] [316/459] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletutil.cpp.o
[14:57:02] :	 [Step 1/2] [317/459] Linking C static library src/secp256k1/libsecp256k1.a
[14:57:02] :	 [Step 1/2] [318/459] Building CXX object src/seeder/CMakeFiles/bitcoin-seeder.dir/main.cpp.o
[14:57:02] :	 [Step 1/2] [319/459] Linking C executable src/secp256k1/ecmult-bench
[14:57:02] :	 [Step 1/2] [320/459] Linking C executable src/secp256k1/recover-bench
[14:57:02] :	 [Step 1/2] [321/459] Linking CXX static library src/libcommon.a
[14:57:02] :	 [Step 1/2] [322/459] Linking C executable src/secp256k1/sign-bench
[14:57:02] :	 [Step 1/2] [323/459] Linking CXX static library src/libscript.a
[14:57:02] :	 [Step 1/2] [324/459] Linking CXX executable src/bitcoin-cli
[14:57:02] :	 [Step 1/2] [325/459] Linking CXX static library src/libbitcoinconsensus.a
[14:57:02] :	 [Step 1/2] [326/459] Linking C executable src/secp256k1/verify-bench
[14:57:02] :	 [Step 1/2] [327/459] Linking CXX shared library src/libbitcoinconsensus.so.0.0.0
[14:57:03] :	 [Step 1/2] [328/459] Creating library symlink src/libbitcoinconsensus.so.0 src/libbitcoinconsensus.so
[14:57:03] :	 [Step 1/2] [329/459] Linking C executable src/secp256k1/internal-bench
[14:57:03] :	 [Step 1/2] [330/459] Linking CXX executable src/bitcoin-tx
[14:57:03] :	 [Step 1/2] [331/459] Building CXX object src/seeder/CMakeFiles/seeder.dir/bitcoin.cpp.o
[14:57:03] :	 [Step 1/2] [332/459] Building CXX object src/seeder/CMakeFiles/seeder.dir/db.cpp.o
[14:57:03] :	 [Step 1/2] [333/459] Building CXX object src/seeder/CMakeFiles/seeder.dir/dns.cpp.o
[14:57:03] :	 [Step 1/2] [334/459] Linking CXX static library src/seeder/libseeder.a
[14:57:03] :	 [Step 1/2] [335/459] Linking CXX executable src/seeder/bitcoin-seeder
[14:57:07] :	 [Step 1/2] [336/459] Building CXX object src/wallet/CMakeFiles/wallet.dir/coincontrol.cpp.o
[14:57:07] :	 [Step 1/2] [337/459] Building CXX object src/wallet/CMakeFiles/wallet.dir/fees.cpp.o
[14:57:07] :	 [Step 1/2] [338/459] Building CXX object src/wallet/CMakeFiles/wallet.dir/psbtwallet.cpp.o
[14:57:07] :	 [Step 1/2] [339/459] Building CXX object src/CMakeFiles/bitcoin-wallet.dir/bitcoin-wallet.cpp.o
[14:57:08] :	 [Step 1/2] [340/459] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpcwallet.cpp.o
[14:57:08] :	 [Step 1/2] FAILED: src/wallet/CMakeFiles/wallet.dir/rpcwallet.cpp.o 
[14:57:08] :	 [Step 1/2] /usr/bin/ccache /usr/bin/clang++-10  -DBOOST_AC_USE_STD_ATOMIC -DBOOST_SP_USE_STD_ATOMIC -DBUILD_BITCOIN_INTERNAL -DENABLE_AVX2 -DENABLE_SHANI -DENABLE_SSE41 -DHAVE_BUILD_INFO -DHAVE_CONFIG_H -DHAVE_CONSENSUS_LIB -DLEVELDB_ATOMIC_PRESENT -DLEVELDB_PLATFORM_POSIX -DOS_LINUX -I../src/. -Isrc -I../src/univalue/include -Isrc/crypto/.. -I../src/secp256k1/include -I../src/leveldb/include -isystem /usr/include/miniupnpc -Werror -g -O2 -fPIC -fvisibility=hidden   -fstack-protector-all -Wstack-protector -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -Wall -Wextra -Wformat -Wvla -Wcast-align -Wunused-parameter -Wmissing-braces -Wthread-safety-analysis -Wshadow -Wrange-loop-analysis -Wredundant-decls -Wformat-security -Wredundant-move -Wno-unused-parameter -Wno-implicit-fallthrough -pthread -std=gnu++14 -MD -MT src/wallet/CMakeFiles/wallet.dir/rpcwallet.cpp.o -MF src/wallet/CMakeFiles/wallet.dir/rpcwallet.cpp.o.d -o src/wallet/CMakeFiles/wallet.dir/rpcwallet.cpp.o -c ../src/wallet/rpcwallet.cpp
[14:57:08] :	 [Step 1/2] ../src/wallet/rpcwallet.cpp:44:20: error: unused function 'GetAvoidReuseFlag' [-Werror,-Wunused-function]
[14:57:08] :	 [Step 1/2] static inline bool GetAvoidReuseFlag(CWallet *const pwallet,
[14:57:08] :	 [Step 1/2]                    ^
[14:57:08] :	 [Step 1/2] 1 error generated.
[14:57:08] :	 [Step 1/2] [341/459] Building CXX object src/CMakeFiles/server.dir/wallet/init.cpp.o
[14:57:08] :	 [Step 1/2] [342/459] Building CXX object src/wallet/CMakeFiles/wallet.dir/load.cpp.o
[14:57:09] :	 [Step 1/2] [343/459] Building CXX object src/wallet/CMakeFiles/wallet-tool.dir/wallettool.cpp.o
[14:57:11] :	 [Step 1/2] [344/459] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletdb.cpp.o
[14:57:12] :	 [Step 1/2] [345/459] Building CXX object src/wallet/CMakeFiles/wallet.dir/__/interfaces/wallet.cpp.o
[14:57:15] :	 [Step 1/2] [346/459] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpcdump.cpp.o
[14:57:21] :	 [Step 1/2] [347/459] Building CXX object src/wallet/CMakeFiles/wallet.dir/wallet.cpp.o
[14:57:21] :	 [Step 1/2] ninja: build stopped: subcommand failed.
[14:57:21]W:	 [Step 1/2] ++ print_sanitizers_log
[14:57:21] :	 [Step 1/2] *** Output of /tmp/sanitizer_logs/*.log.* ***
[14:57:21]W:	 [Step 1/2] ++ for log in "${SAN_LOG_DIR}"/*.log.*
[14:57:21]W:	 [Step 1/2] ++ echo '*** Output of /tmp/sanitizer_logs/*.log.* ***'
[14:57:21]W:	 [Step 1/2] ++ cat '/tmp/sanitizer_logs/*.log.*'
[14:57:21]W:	 [Step 1/2] cat: '/tmp/sanitizer_logs/*.log.*': No such file or directory
[14:57:21]W:	 [Step 1/2] cp: cannot stat '/work/ibd/debug.log': No such file or directory
[14:57:25]W:	 [Step 1/2] Process exited with code 1
[14:57:25]E:	 [Step 1/2] Process exited with code 1 (Step: Command Line)
deadalnix requested changes to this revision.Jun 4 2020, 17:57
deadalnix added a subscriber: deadalnix.

Looks like clang is not happy.

This revision now requires changes to proceed.Jun 4 2020, 17:57

good job Clang. this was a test. and you passed.

deadalnix added inline comments.
src/wallet/rpcwallet.cpp
44

Make sure to remove that annotation once the function is actually used.

This revision is now accepted and ready to land.Jun 4 2020, 22:40