From 3c5dcb036aee7052c4eb19ee26e8abd2664e4fbf Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Wed, 16 Oct 2019 17:33:48 -0400 Subject: [PATCH 1/2] Merge #16659: refactoring: Remove unused includes 084e17cebd424b8e8ced674bc810eef4e6ee5d3b Remove unused includes (practicalswift) Pull request description: As requested by MarcoFalke in https://github.com/bitcoin/bitcoin/pull/16273#issuecomment-521332089: This PR removes unused includes. Please note that in contrast to #16273 I'm limiting the scope to the trivial cases of pure removals (i.e. no includes added) to make reviewing easier. I'm seeking "Concept ACK":s for this obviously non-urgent minor cleanup. Rationale: * Avoids unnecessary re-compiles in case of header changes. * Makes reasoning about code dependencies easier. * Reduces compile-time memory usage. * Reduces compilation time. * Warm fuzzy feeling of being lean :-) ACKs for top commit: ryanofsky: Code review ACK 084e17cebd424b8e8ced674bc810eef4e6ee5d3b. PR only removes include lines and it still compiles. In the worst case someone might have to explicitly add an include later for something now included implicitly. But maybe some effort was taken to avoid this, and it wouldn't be a tragedy anyway. Tree-SHA512: 89de56edc6ceea4696e9579bccff10c80080821685b9fb4e8c5ef593b6e43cf662f358788701bb09f84867693f66b2e4db035b92b522a0a775f50b7ecffd6a6d --- src/arith_uint256.cpp | 2 -- src/arith_uint256.h | 2 -- src/bench/base58.cpp | 1 - src/bench/bench.h | 1 - src/bench/block_assemble.cpp | 1 - src/bench/chacha20.cpp | 1 - src/bench/chacha_poly_aead.cpp | 1 - src/bench/duplicate_inputs.cpp | 3 --- src/bench/lockedpool.cpp | 1 - src/bench/mempool_eviction.cpp | 2 -- src/bench/poly1305.cpp | 1 - src/bench/rollingbloom.cpp | 1 - src/bench/rpc_mempool.cpp | 2 -- src/blockencodings.h | 1 - src/compressor.cpp | 1 - src/consensus/merkle.h | 2 -- src/consensus/params.h | 2 -- src/crypto/aes.cpp | 1 - src/crypto/chacha_poly_aead.cpp | 1 - src/crypto/sha256.cpp | 1 - src/crypto/sha256_shani.cpp | 1 - src/dash-cli.cpp | 1 - src/dash-tx.cpp | 1 - src/dash-wallet.cpp | 2 -- src/dashd.cpp | 3 +-- src/dbwrapper.h | 1 - src/dummywallet.cpp | 2 -- src/httprpc.cpp | 2 -- src/httprpc.h | 2 -- src/httpserver.cpp | 1 - src/httpserver.h | 1 - src/index/base.h | 1 - src/interfaces/chain.cpp | 2 -- src/interfaces/node.cpp | 3 --- src/interfaces/wallet.cpp | 2 -- src/key_io.cpp | 1 - src/miner.cpp | 2 -- src/net.cpp | 3 --- src/net_processing.cpp | 1 - src/netaddress.h | 1 - src/node/coinstats.cpp | 2 -- src/node/transaction.cpp | 3 +-- src/node/transaction.h | 1 - src/noui.cpp | 2 -- src/policy/fees.cpp | 1 - src/prevector.h | 1 - src/primitives/block.cpp | 1 - src/protocol.h | 1 - src/qt/bantablemodel.cpp | 2 -- src/qt/coincontroldialog.cpp | 1 - src/qt/peertablemodel.cpp | 2 -- src/qt/signverifymessagedialog.cpp | 1 - src/qt/splashscreen.cpp | 1 - src/qt/test/paymentservertests.cpp | 1 - src/qt/transactiondesc.cpp | 1 - src/qt/walletframe.cpp | 1 - src/qt/walletmodel.h | 1 - src/qt/walletmodeltransaction.h | 1 - src/random.cpp | 2 -- src/rest.cpp | 1 - src/rpc/blockchain.cpp | 1 - src/rpc/client.cpp | 1 - src/rpc/net.cpp | 1 - src/rpc/rawtransaction.cpp | 2 -- src/rpc/server.cpp | 2 -- src/rpc/server.h | 2 -- src/script/interpreter.h | 1 - src/script/ismine.cpp | 1 - src/script/sign.h | 1 - src/script/standard.h | 1 - src/serialize.h | 1 - src/streams.h | 2 -- src/sync.cpp | 2 -- src/test/bip32_tests.cpp | 1 - src/test/compress_tests.cpp | 1 - src/test/policyestimator_tests.cpp | 1 - src/test/pow_tests.cpp | 1 - src/test/skiplist_tests.cpp | 1 - src/test/streams_tests.cpp | 1 - src/test/txindex_tests.cpp | 1 - src/threadinterrupt.h | 1 - src/torcontrol.h | 1 - src/txdb.h | 1 - src/txmempool.h | 1 - src/ui_interface.h | 1 - src/uint256.cpp | 1 - src/uint256.h | 1 - src/util/moneystr.cpp | 1 - src/util/moneystr.h | 1 - src/util/system.cpp | 1 - src/util/threadnames.cpp | 1 - src/validation.cpp | 3 --- src/validation.h | 2 -- src/validationinterface.cpp | 2 -- src/wallet/crypter.cpp | 3 --- src/wallet/crypter.h | 1 - src/wallet/db.h | 2 -- src/wallet/fees.cpp | 1 - src/wallet/init.cpp | 1 - src/wallet/psbtwallet.h | 2 -- src/wallet/rpcdump.cpp | 1 - src/wallet/rpcwallet.cpp | 2 -- src/wallet/wallet.cpp | 1 - src/wallet/walletdb.h | 2 -- src/wallet/wallettool.h | 1 - src/warnings.h | 1 - src/zmq/zmqnotificationinterface.cpp | 1 - src/zmq/zmqnotificationinterface.h | 2 -- 108 files changed, 2 insertions(+), 150 deletions(-) diff --git a/src/arith_uint256.cpp b/src/arith_uint256.cpp index 5273e13c81..f4cd70255a 100644 --- a/src/arith_uint256.cpp +++ b/src/arith_uint256.cpp @@ -9,8 +9,6 @@ #include #include -#include -#include template base_uint::base_uint(const std::string& str) diff --git a/src/arith_uint256.h b/src/arith_uint256.h index 6248ac4e3f..0b3332724f 100644 --- a/src/arith_uint256.h +++ b/src/arith_uint256.h @@ -6,13 +6,11 @@ #ifndef BITCOIN_ARITH_UINT256_H #define BITCOIN_ARITH_UINT256_H -#include #include #include #include #include #include -#include class uint256; diff --git a/src/bench/base58.cpp b/src/bench/base58.cpp index 1521982baf..8199decd38 100644 --- a/src/bench/base58.cpp +++ b/src/bench/base58.cpp @@ -9,7 +9,6 @@ #include #include -#include static void Base58Encode(benchmark::Bench& bench) diff --git a/src/bench/bench.h b/src/bench/bench.h index 6f0022befd..955e85a201 100644 --- a/src/bench/bench.h +++ b/src/bench/bench.h @@ -6,7 +6,6 @@ #define BITCOIN_BENCH_BENCH_H #include -#include #include #include #include diff --git a/src/bench/block_assemble.cpp b/src/bench/block_assemble.cpp index aa31d3e6fe..e3e50dab96 100644 --- a/src/bench/block_assemble.cpp +++ b/src/bench/block_assemble.cpp @@ -12,7 +12,6 @@ #include -#include #include static void AssembleBlock(benchmark::Bench& bench) diff --git a/src/bench/chacha20.cpp b/src/bench/chacha20.cpp index a1b36cf250..33573a978b 100644 --- a/src/bench/chacha20.cpp +++ b/src/bench/chacha20.cpp @@ -2,7 +2,6 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#include #include #include diff --git a/src/bench/chacha_poly_aead.cpp b/src/bench/chacha_poly_aead.cpp index e6a1c56fd2..c0c44e289d 100644 --- a/src/bench/chacha_poly_aead.cpp +++ b/src/bench/chacha_poly_aead.cpp @@ -2,7 +2,6 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#include #include #include diff --git a/src/bench/duplicate_inputs.cpp b/src/bench/duplicate_inputs.cpp index 7f1f4953bf..d803ac2b56 100644 --- a/src/bench/duplicate_inputs.cpp +++ b/src/bench/duplicate_inputs.cpp @@ -4,7 +4,6 @@ #include #include -#include #include #include #include @@ -15,8 +14,6 @@ #include #include -#include -#include static void DuplicateInputs(benchmark::Bench& bench) diff --git a/src/bench/lockedpool.cpp b/src/bench/lockedpool.cpp index 194175eece..61211c8162 100644 --- a/src/bench/lockedpool.cpp +++ b/src/bench/lockedpool.cpp @@ -6,7 +6,6 @@ #include -#include #include #define ASIZE 2048 diff --git a/src/bench/mempool_eviction.cpp b/src/bench/mempool_eviction.cpp index 6be0fb0a4e..74460d54a0 100644 --- a/src/bench/mempool_eviction.cpp +++ b/src/bench/mempool_eviction.cpp @@ -6,8 +6,6 @@ #include #include -#include -#include static void AddTx(const CTransactionRef& tx, const CAmount& nFee, CTxMemPool& pool) EXCLUSIVE_LOCKS_REQUIRED(cs_main, pool.cs) { diff --git a/src/bench/poly1305.cpp b/src/bench/poly1305.cpp index 8274949f0d..9745d3fcb1 100644 --- a/src/bench/poly1305.cpp +++ b/src/bench/poly1305.cpp @@ -2,7 +2,6 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#include #include #include diff --git a/src/bench/rollingbloom.cpp b/src/bench/rollingbloom.cpp index f3c0159347..541abe5a32 100644 --- a/src/bench/rollingbloom.cpp +++ b/src/bench/rollingbloom.cpp @@ -2,7 +2,6 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#include #include #include diff --git a/src/bench/rpc_mempool.cpp b/src/bench/rpc_mempool.cpp index 671cb7f0ae..f862421f0d 100644 --- a/src/bench/rpc_mempool.cpp +++ b/src/bench/rpc_mempool.cpp @@ -9,8 +9,6 @@ #include -#include -#include static void AddTx(const CTransactionRef& tx, const CAmount& fee, CTxMemPool& pool) EXCLUSIVE_LOCKS_REQUIRED(cs_main, pool.cs) { diff --git a/src/blockencodings.h b/src/blockencodings.h index 2f3a829796..748d51e068 100644 --- a/src/blockencodings.h +++ b/src/blockencodings.h @@ -7,7 +7,6 @@ #include -#include class CTxMemPool; diff --git a/src/compressor.cpp b/src/compressor.cpp index b003a86ce7..568b182f4c 100644 --- a/src/compressor.cpp +++ b/src/compressor.cpp @@ -5,7 +5,6 @@ #include -#include #include #include