diff --git a/ci/test/03_test_script.sh b/ci/test/03_test_script.sh index 834473b1ada..abc501d1d0b 100755 --- a/ci/test/03_test_script.sh +++ b/ci/test/03_test_script.sh @@ -234,7 +234,7 @@ fi if [[ "${RUN_IWYU}" == true ]]; then # TODO: Consider enforcing IWYU across the entire codebase. - FILES_WITH_ENFORCED_IWYU='/src/((bench|common|crypto|index|kernel|primitives|script|univalue/(lib|test)|util|zmq)/.*|node/(blockstorage|interfaces|miner|mining_args|utxo_snapshot)|rpc/mining|clientversion|core_io|signet|init)\.cpp' + FILES_WITH_ENFORCED_IWYU='/src/((bench|common|consensus|crypto|index|kernel|primitives|script|univalue/(lib|test)|util|zmq)/.*|node/(blockstorage|interfaces|miner|mining_args|utxo_snapshot)|rpc/mining|clientversion|core_io|signet|init)\.cpp' jq --arg patterns "$FILES_WITH_ENFORCED_IWYU" 'map(select(.file | test($patterns)))' "${BASE_BUILD_DIR}/compile_commands.json" > "${BASE_BUILD_DIR}/compile_commands_iwyu_errors.json" jq --arg patterns "$FILES_WITH_ENFORCED_IWYU" 'map(select(.file | test($patterns) | not))' "${BASE_BUILD_DIR}/compile_commands.json" > "${BASE_BUILD_DIR}/compile_commands_iwyu_warnings.json" @@ -248,6 +248,7 @@ if [[ "${RUN_IWYU}" == true ]]; then -- -Xiwyu --cxx17ns -Xiwyu --mapping_file="${BASE_ROOT_DIR}/contrib/devtools/iwyu/bitcoin.core.imp" \ -Xiwyu --max_line_length=160 \ -Xiwyu --check_also='*/common/types\.h' \ + -Xiwyu --check_also='*/consensus/*\.h' \ -Xiwyu --check_also='*/primitives/transaction_identifier\.h' \ 2>&1 || true } | tee /tmp/iwyu_ci.out diff --git a/src/consensus/consensus.h b/src/consensus/consensus.h index 71b5fe2468d..f1595f31d3f 100644 --- a/src/consensus/consensus.h +++ b/src/consensus/consensus.h @@ -6,8 +6,8 @@ #ifndef BITCOIN_CONSENSUS_CONSENSUS_H #define BITCOIN_CONSENSUS_CONSENSUS_H +#include #include -#include /** The maximum allowed size for a serialized block, in bytes (only for buffer size limits) */ static const unsigned int MAX_BLOCK_SERIALIZED_SIZE = 4000000; diff --git a/src/consensus/merkle.cpp b/src/consensus/merkle.cpp index c6ae81c6142..dfa23cf897d 100644 --- a/src/consensus/merkle.cpp +++ b/src/consensus/merkle.cpp @@ -3,9 +3,17 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include + +#include #include +#include +#include #include +#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 that the following merkle tree algorithm has a serious flaw related to diff --git a/src/consensus/merkle.h b/src/consensus/merkle.h index 03b5a1b5aac..446b2df75ae 100644 --- a/src/consensus/merkle.h +++ b/src/consensus/merkle.h @@ -5,10 +5,12 @@ #ifndef BITCOIN_CONSENSUS_MERKLE_H #define BITCOIN_CONSENSUS_MERKLE_H +#include + +#include #include -#include -#include +class CBlock; uint256 ComputeMerkleRoot(std::vector hashes, bool* mutated = nullptr); diff --git a/src/consensus/params.h b/src/consensus/params.h index 7f56729455a..99096e06d9a 100644 --- a/src/consensus/params.h +++ b/src/consensus/params.h @@ -11,6 +11,7 @@ #include #include +#include #include #include #include diff --git a/src/consensus/tx_check.cpp b/src/consensus/tx_check.cpp index 251417c8795..473538e4fe5 100644 --- a/src/consensus/tx_check.cpp +++ b/src/consensus/tx_check.cpp @@ -5,8 +5,16 @@ #include #include -#include +#include #include +#include +#include