From 31484500322a5e6b58fcd8159f4753cbadb11269 Mon Sep 17 00:00:00 2001 From: Vijay Manikpuri <2348066+vijaydasmp@users.noreply.github.com> Date: Tue, 4 Jan 2022 00:40:02 +0530 Subject: [PATCH] Merge #16129: refactor: Remove unused includes (#4623) 67f4e9c522 Include core_io.h from core_read.cpp (practicalswift) eca9767673 Make reasoning about dependencies easier by not including unused dependencies (practicalswift) Pull request description: Make reasoning about dependencies easier by not including unused dependencies. Please note that the removed headers are _not_ "transitively included" by other still included headers. Thus the removals are real. As an added bonus this change means less work for the preprocessor/compiler. At least 51 393 lines of code no longer needs to be processed: ``` $ git diff -u HEAD~1 | grep -E '^\-#include ' | cut -f2 -d"<" | cut -f1 -d">" | \ sed 's%^%src/%g' | xargs cat | wc -l 51393 ``` Note that 51 393 is the lower bound: the real number is likely much higher when taking into account transitively included headers :-) ACKs for commit 67f4e9: Tree-SHA512: 0c8868aac59813f099ce53d5307eed7962dd6f2ff3546768ef9e5c4508b87f8210f1a22c7e826c3c06bebbf28bdbfcf1628ed354c2d0fdb9a31a42cefb8fdf13 Co-authored-by: MarcoFalke --- src/addrman.cpp | 1 - src/arith_uint256.cpp | 1 - src/bench/rpc_mempool.cpp | 1 - src/consensus/merkle.cpp | 1 - src/core_write.cpp | 1 - src/crypto/aes.cpp | 1 - src/crypto/sha256_avx2.cpp | 1 - src/crypto/sha256_sse41.cpp | 1 - src/dash-wallet.cpp | 1 - src/dashd.cpp | 4 ---- src/httprpc.cpp | 1 - src/init.cpp | 1 - src/interfaces/node.cpp | 1 - src/interfaces/wallet.cpp | 3 --- src/key.cpp | 1 - src/merkleblock.cpp | 1 - src/miner.cpp | 1 - src/net_processing.cpp | 1 - src/netbase.cpp | 1 - src/policy/policy.cpp | 1 - src/primitives/block.cpp | 1 - src/qt/addressbookpage.cpp | 1 - src/qt/addresstablemodel.cpp | 1 - src/qt/bantablemodel.cpp | 2 -- src/qt/bitcoinunits.cpp | 1 - src/qt/clientmodel.cpp | 6 ------ src/qt/coincontroldialog.cpp | 4 ---- src/qt/dash.cpp | 4 ---- src/qt/receivecoinsdialog.cpp | 2 -- src/qt/test/addressbooktests.cpp | 2 -- src/qt/test/apptests.cpp | 4 ---- src/qt/test/rpcnestedtests.cpp | 4 ---- src/qt/test/wallettests.cpp | 2 -- src/qt/transactionrecord.cpp | 3 --- src/qt/transactiontablemodel.cpp | 3 --- src/qt/utilitydialog.cpp | 4 ---- src/qt/walletmodeltransaction.cpp | 1 - src/rpc/misc.cpp | 1 - src/rpc/net.cpp | 2 -- src/rpc/rawtransaction.cpp | 1 - src/rpc/server.cpp | 1 - src/script/standard.cpp | 1 - src/test/coins_tests.cpp | 1 - src/test/denialofservice_tests.cpp | 1 - src/test/multisig_tests.cpp | 1 - src/test/script_p2sh_tests.cpp | 1 - src/test/setup_common.cpp | 1 - src/test/txvalidationcache_tests.cpp | 1 - src/test/util.cpp | 2 -- src/timedata.cpp | 1 - src/txdb.cpp | 2 -- src/txmempool.cpp | 2 -- src/ui_interface.cpp | 1 - src/util/system.cpp | 2 -- src/validationinterface.cpp | 1 - src/wallet/db.cpp | 3 --- src/wallet/fees.cpp | 2 -- src/wallet/init.cpp | 1 - src/wallet/rpcwallet.cpp | 1 - src/wallet/test/init_tests.cpp | 3 --- src/wallet/test/psbt_wallet_tests.cpp | 1 - src/wallet/test/wallet_test_fixture.cpp | 2 -- src/wallet/wallet.cpp | 3 --- src/wallet/wallettool.cpp | 1 - src/warnings.cpp | 1 - src/zmq/zmqabstractnotifier.cpp | 1 - src/zmq/zmqnotificationinterface.cpp | 1 - test/lint/lint-circular-dependencies.sh | 10 ++-------- 68 files changed, 2 insertions(+), 121 deletions(-) diff --git a/src/addrman.cpp b/src/addrman.cpp index df8b131857..b548a7872a 100644 --- a/src/addrman.cpp +++ b/src/addrman.cpp @@ -7,7 +7,6 @@ #include #include -#include #include int CAddrInfo::GetTriedBucket(const uint256& nKey, const std::vector &asmap) const diff --git a/src/arith_uint256.cpp b/src/arith_uint256.cpp index f4cd70255a..04d54d1ad5 100644 --- a/src/arith_uint256.cpp +++ b/src/arith_uint256.cpp @@ -6,7 +6,6 @@ #include #include -#include #include diff --git a/src/bench/rpc_mempool.cpp b/src/bench/rpc_mempool.cpp index f862421f0d..5cb2ce78cc 100644 --- a/src/bench/rpc_mempool.cpp +++ b/src/bench/rpc_mempool.cpp @@ -3,7 +3,6 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include -#include #include #include diff --git a/src/consensus/merkle.cpp b/src/consensus/merkle.cpp index e52c05d40a..8698d6864a 100644 --- a/src/consensus/merkle.cpp +++ b/src/consensus/merkle.cpp @@ -4,7 +4,6 @@ #include #include -#include /* WARNING! If you're reading this because you're learning about crypto and/or designing a new system that will use merkle trees, keep in mind diff --git a/src/core_write.cpp b/src/core_write.cpp index ba35a821b8..e465dc09d4 100644 --- a/src/core_write.cpp +++ b/src/core_write.cpp @@ -12,7 +12,6 @@ #include #include #include -#include #include #include diff --git a/src/crypto/aes.cpp b/src/crypto/aes.cpp index ec19b39531..0dd48e1023 100644 --- a/src/crypto/aes.cpp +++ b/src/crypto/aes.cpp @@ -3,7 +3,6 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include -#include #include diff --git a/src/crypto/sha256_avx2.cpp b/src/crypto/sha256_avx2.cpp index 068e0e5ff6..90a72516a4 100644 --- a/src/crypto/sha256_avx2.cpp +++ b/src/crypto/sha256_avx2.cpp @@ -3,7 +3,6 @@ #include #include -#include #include namespace sha256d64_avx2 { diff --git a/src/crypto/sha256_sse41.cpp b/src/crypto/sha256_sse41.cpp index adca870e2d..fc79f46f7f 100644 --- a/src/crypto/sha256_sse41.cpp +++ b/src/crypto/sha256_sse41.cpp @@ -3,7 +3,6 @@ #include #include -#include #include namespace sha256d64_sse41 { diff --git a/src/dash-wallet.cpp b/src/dash-wallet.cpp index 6d968303da..ee3027d9a2 100644 --- a/src/dash-wallet.cpp +++ b/src/dash-wallet.cpp @@ -8,7 +8,6 @@ #include #include -#include #include #include #include diff --git a/src/dashd.cpp b/src/dashd.cpp index 2d65209a7e..c0efa23484 100644 --- a/src/dashd.cpp +++ b/src/dashd.cpp @@ -13,15 +13,11 @@ #include #include #include -#include #include #include #include -#include -#include #include #include -#include #include #include diff --git a/src/httprpc.cpp b/src/httprpc.cpp index 4572ce99bc..e501765f6f 100644 --- a/src/httprpc.cpp +++ b/src/httprpc.cpp @@ -8,7 +8,6 @@ #include #include #include -#include #include #include #include diff --git a/src/init.cpp b/src/init.cpp index 61ec56e95f..1605391ae4 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -70,7 +70,6 @@ #include #include #include -#include #include #include diff --git a/src/interfaces/node.cpp b/src/interfaces/node.cpp index 737bbc2461..73c8f1df82 100644 --- a/src/interfaces/node.cpp +++ b/src/interfaces/node.cpp @@ -26,7 +26,6 @@ #include #include #include -#include #include #include #include diff --git a/src/interfaces/wallet.cpp b/src/interfaces/wallet.cpp index 2ae98a6936..2a5fe32d8e 100644 --- a/src/interfaces/wallet.cpp +++ b/src/interfaces/wallet.cpp @@ -9,11 +9,8 @@ #include #include #include -#include #include #include -#include -#include #include