diff --git a/src/banman.h b/src/banman.h index 1c534f653f..e7eef39f85 100644 --- a/src/banman.h +++ b/src/banman.h @@ -97,4 +97,4 @@ private: CRollingBloomFilter m_discouraged GUARDED_BY(m_cs_banned) {50000, 0.000001}; }; -#endif +#endif // BITCOIN_BANMAN_H diff --git a/src/batchedlogger.h b/src/batchedlogger.h index 6f2b13bf9b..d653ccf3fd 100644 --- a/src/batchedlogger.h +++ b/src/batchedlogger.h @@ -35,4 +35,4 @@ public: void Flush(); }; -#endif//BITCOIN_BATCHEDLOGGER_H +#endif // BITCOIN_BATCHEDLOGGER_H diff --git a/src/coinjoin/common.h b/src/coinjoin/common.h index def3ffc83a..7b7c939f11 100644 --- a/src/coinjoin/common.h +++ b/src/coinjoin/common.h @@ -132,4 +132,4 @@ constexpr int CalculateAmountPriority(CAmount nInputAmount) } // namespace CoinJoin -#endif +#endif // BITCOIN_COINJOIN_COMMON_H diff --git a/src/consensus/amount.h b/src/consensus/amount.h index 96566ea13f..59b8e3417a 100644 --- a/src/consensus/amount.h +++ b/src/consensus/amount.h @@ -26,4 +26,4 @@ static constexpr CAmount COIN = 100000000; static constexpr CAmount MAX_MONEY = 21000000 * COIN; inline bool MoneyRange(const CAmount& nValue) { return (nValue >= 0 && nValue <= MAX_MONEY); } -#endif // BITCOIN_CONSENSUS_AMOUNT_H +#endif // BITCOIN_CONSENSUS_AMOUNT_H diff --git a/src/context.h b/src/context.h index d792df2944..39da4ec9a8 100644 --- a/src/context.h +++ b/src/context.h @@ -33,4 +33,4 @@ T* GetContext(const CoreContext& context) noexcept : nullptr; } -#endif // BITCOIN_CONTEXT_VARIANT_H +#endif // BITCOIN_CONTEXT_H diff --git a/src/evo/creditpool.h b/src/evo/creditpool.h index 4d4169974d..de6f13595b 100644 --- a/src/evo/creditpool.h +++ b/src/evo/creditpool.h @@ -141,4 +141,4 @@ std::optional GetCreditPoolDiffForBlock(CCreditPoolManager& cpo const CBlock& block, const CBlockIndex* pindexPrev, const Consensus::Params& consensusParams, const CAmount blockSubsidy, BlockValidationState& state); -#endif +#endif // BITCOIN_EVO_CREDITPOOL_H diff --git a/src/evo/dmnstate.h b/src/evo/dmnstate.h index acee5c2b49..a9eef0b555 100644 --- a/src/evo/dmnstate.h +++ b/src/evo/dmnstate.h @@ -377,4 +377,4 @@ public: }; -#endif //BITCOIN_EVO_DMNSTATE_H +#endif // BITCOIN_EVO_DMNSTATE_H diff --git a/src/governance/common.h b/src/governance/common.h index ae053d8504..48606f39b7 100644 --- a/src/governance/common.h +++ b/src/governance/common.h @@ -81,6 +81,6 @@ public: } } }; - } // namespace Governance -#endif + +#endif // BITCOIN_GOVERNANCE_COMMON_H diff --git a/src/httprpc.h b/src/httprpc.h index 18f8551816..d85a46f025 100644 --- a/src/httprpc.h +++ b/src/httprpc.h @@ -31,4 +31,4 @@ void InterruptREST(); */ void StopREST(); -#endif +#endif // BITCOIN_HTTPRPC_H diff --git a/src/i2p.h b/src/i2p.h index 6183885435..f9619de9c5 100644 --- a/src/i2p.h +++ b/src/i2p.h @@ -286,4 +286,4 @@ private: } // namespace sam } // namespace i2p -#endif /* BITCOIN_I2P_H */ +#endif // BITCOIN_I2P_H diff --git a/src/llmq/snapshot.h b/src/llmq/snapshot.h index f02698704a..e1e32751c5 100644 --- a/src/llmq/snapshot.h +++ b/src/llmq/snapshot.h @@ -233,4 +233,4 @@ extern std::unique_ptr quorumSnapshotManager; } // namespace llmq -#endif //BITCOIN_LLMQ_SNAPSHOT_H +#endif // BITCOIN_LLMQ_SNAPSHOT_H diff --git a/src/node/psbt.h b/src/node/psbt.h index fd2f063351..8f41ec2291 100644 --- a/src/node/psbt.h +++ b/src/node/psbt.h @@ -50,4 +50,4 @@ struct PSBTAnalysis { */ PSBTAnalysis AnalyzePSBT(PartiallySignedTransaction psbtx); -#endif // BITCOIN_PSBT_H +#endif // BITCOIN_NODE_PSBT_H diff --git a/src/policy/feerate.h b/src/policy/feerate.h index df700dfed5..f0d82a7402 100644 --- a/src/policy/feerate.h +++ b/src/policy/feerate.h @@ -66,4 +66,4 @@ public: SERIALIZE_METHODS(CFeeRate, obj) { READWRITE(obj.nSatoshisPerK); } }; -#endif // BITCOIN_POLICY_FEERATE_H +#endif // BITCOIN_POLICY_FEERATE_H diff --git a/src/randomenv.h b/src/randomenv.h index 46cea6f6f2..746516b79b 100644 --- a/src/randomenv.h +++ b/src/randomenv.h @@ -14,4 +14,4 @@ void RandAddDynamicEnv(CSHA512& hasher); /** Gather non-cryptographic environment data that does not change over time. */ void RandAddStaticEnv(CSHA512& hasher); -#endif +#endif // BITCOIN_RANDOMENV_H diff --git a/src/rpc/blockchain.h b/src/rpc/blockchain.h index e383aba436..15a1d0e723 100644 --- a/src/rpc/blockchain.h +++ b/src/rpc/blockchain.h @@ -64,4 +64,4 @@ void TxToUniv(const CTransaction& tx, const uint256& hashBlock, UniValue& entry, */ UniValue CreateUTXOSnapshot(NodeContext& node, CChainState& chainstate, CAutoFile& afile); -#endif +#endif // BITCOIN_RPC_BLOCKCHAIN_H diff --git a/src/rpc/index_util.h b/src/rpc/index_util.h index 6bd3b73124..a2a632c8d1 100644 --- a/src/rpc/index_util.h +++ b/src/rpc/index_util.h @@ -42,4 +42,4 @@ bool GetTimestampIndex(CBlockTreeDB& block_tree_db, const uint32_t high, const u std::vector& hashes) EXCLUSIVE_LOCKS_REQUIRED(::cs_main); -#endif // BITCOIN_RPC_CLIENT_H +#endif // BITCOIN_RPC_INDEX_UTIL_H diff --git a/src/scheduler.h b/src/scheduler.h index 438fb8c126..727270e195 100644 --- a/src/scheduler.h +++ b/src/scheduler.h @@ -152,4 +152,4 @@ public: size_t CallbacksPending() EXCLUSIVE_LOCKS_REQUIRED(!m_callbacks_mutex); }; -#endif +#endif // BITCOIN_SCHEDULER_H diff --git a/src/shutdown.h b/src/shutdown.h index 31a0b441a4..3e22bfd0f0 100644 --- a/src/shutdown.h +++ b/src/shutdown.h @@ -36,4 +36,4 @@ bool RestartRequested(); */ void WaitForShutdown(); -#endif +#endif // BITCOIN_SHUTDOWN_H diff --git a/src/span.h b/src/span.h index 84a3f4b140..a7ebd48cc7 100644 --- a/src/span.h +++ b/src/span.h @@ -295,4 +295,4 @@ template return span.end(); } -#endif +#endif // BITCOIN_SPAN_H diff --git a/src/stacktraces.h b/src/stacktraces.h index 01ae135ee8..e6f577a818 100644 --- a/src/stacktraces.h +++ b/src/stacktraces.h @@ -37,4 +37,4 @@ inline std::string GetExceptionWhat(const T& e) void RegisterPrettyTerminateHander(); void RegisterPrettySignalHandlers(); -#endif//BITCOIN_STACKTRACES_H +#endif // BITCOIN_STACKTRACES_H diff --git a/src/test/scriptnum10.h b/src/test/scriptnum10.h index 352797f18d..3937366f01 100644 --- a/src/test/scriptnum10.h +++ b/src/test/scriptnum10.h @@ -179,4 +179,4 @@ private: }; -#endif // BITCOIN_TEST_BIGNUM_H +#endif // BITCOIN_TEST_SCRIPTNUM10_H diff --git a/src/test/util/setup_common.h b/src/test/util/setup_common.h index f21205cff2..639c96ffe7 100644 --- a/src/test/util/setup_common.h +++ b/src/test/util/setup_common.h @@ -250,4 +250,4 @@ private: // define an implicit conversion here so that uint256 may be used directly in BOOST_CHECK_* std::ostream& operator<<(std::ostream& os, const uint256& num); -#endif +#endif // BITCOIN_TEST_UTIL_SETUP_COMMON_H diff --git a/src/threadinterrupt.h b/src/threadinterrupt.h index c053c01499..bf7945a0a1 100644 --- a/src/threadinterrupt.h +++ b/src/threadinterrupt.h @@ -32,4 +32,4 @@ private: std::atomic flag; }; -#endif //BITCOIN_THREADINTERRUPT_H +#endif // BITCOIN_THREADINTERRUPT_H diff --git a/src/torcontrol.h b/src/torcontrol.h index 75464b148e..97dadd88fd 100644 --- a/src/torcontrol.h +++ b/src/torcontrol.h @@ -159,4 +159,4 @@ public: static void reconnect_cb(evutil_socket_t fd, short what, void *arg); }; -#endif /* BITCOIN_TORCONTROL_H */ +#endif // BITCOIN_TORCONTROL_H diff --git a/src/util/edge.h b/src/util/edge.h index 1137ce624a..8e3ec357a1 100644 --- a/src/util/edge.h +++ b/src/util/edge.h @@ -59,4 +59,4 @@ private: int m_fd{-1}; }; -#endif /* BITCOIN_UTIL_EDGE_H */ +#endif // BITCOIN_UTIL_EDGE_H diff --git a/src/util/readwritefile.h b/src/util/readwritefile.h index 1dab874b38..a59d0be131 100644 --- a/src/util/readwritefile.h +++ b/src/util/readwritefile.h @@ -25,4 +25,4 @@ std::pair ReadBinaryFile(const fs::path &filename, size_t maxs */ bool WriteBinaryFile(const fs::path &filename, const std::string &data); -#endif /* BITCOIN_UTIL_READWRITEFILE_H */ +#endif // BITCOIN_UTIL_READWRITEFILE_H diff --git a/src/util/trace.h b/src/util/trace.h index ec468330d7..d0fd841edf 100644 --- a/src/util/trace.h +++ b/src/util/trace.h @@ -55,4 +55,4 @@ #endif -#endif /* BITCOIN_UTIL_TRACE_H */ +#endif // BITCOIN_UTIL_TRACE_H diff --git a/src/util/underlying.h b/src/util/underlying.h index aa036b18fb..55821bb742 100644 --- a/src/util/underlying.h +++ b/src/util/underlying.h @@ -11,4 +11,4 @@ template return static_cast::type>(e); } -#endif //BITCOIN_UTIL_UNDERLYING_H +#endif // BITCOIN_UTIL_UNDERLYING_H diff --git a/src/util/wpipe.h b/src/util/wpipe.h index c4fff558ec..30912149b4 100644 --- a/src/util/wpipe.h +++ b/src/util/wpipe.h @@ -56,4 +56,4 @@ private: EdgeTriggeredEvents* m_edge_trig_events{nullptr}; }; -#endif /* BITCOIN_UTIL_WPIPE_H */ +#endif // BITCOIN_UTIL_WPIPE_H diff --git a/src/wallet/rpcwallet.h b/src/wallet/rpcwallet.h index 5c8c643a43..ce3d5a659f 100644 --- a/src/wallet/rpcwallet.h +++ b/src/wallet/rpcwallet.h @@ -41,4 +41,4 @@ RPCHelpMan getaddressinfo(); RPCHelpMan getrawchangeaddress(); RPCHelpMan addmultisigaddress(); RPCHelpMan signrawtransactionwithwallet(); -#endif //BITCOIN_WALLET_RPCWALLET_H +#endif // BITCOIN_WALLET_RPCWALLET_H diff --git a/src/warnings.h b/src/warnings.h index c38edb4570..7ab0a93e3f 100644 --- a/src/warnings.h +++ b/src/warnings.h @@ -20,4 +20,4 @@ void SetfLargeWorkInvalidChainFound(bool flag); */ bilingual_str GetWarnings(bool verbose); -#endif // BITCOIN_WARNINGS_H +#endif // BITCOIN_WARNINGS_H diff --git a/src/zmq/zmqrpc.h b/src/zmq/zmqrpc.h index 5a810a16fb..8538adf9d3 100644 --- a/src/zmq/zmqrpc.h +++ b/src/zmq/zmqrpc.h @@ -9,4 +9,4 @@ class CRPCTable; void RegisterZMQRPCCommands(CRPCTable& t); -#endif // BITCOIN_ZMQ_ZMRRPC_H +#endif // BITCOIN_ZMQ_ZMQRPC_H diff --git a/test/lint/lint-include-guards.sh b/test/lint/lint-include-guards.sh index e88680aec0..3bf00e23e6 100755 --- a/test/lint/lint-include-guards.sh +++ b/test/lint/lint-include-guards.sh @@ -17,7 +17,7 @@ for HEADER_FILE in $(git ls-files -- "*.h" | grep -vE "^${REGEXP_EXCLUDE_FILES_W do HEADER_ID_BASE=$(cut -f2- -d/ <<< "${HEADER_FILE}" | sed "s/\.h$//g" | tr / _ | tr - _ | tr "[:lower:]" "[:upper:]") HEADER_ID="${HEADER_ID_PREFIX}${HEADER_ID_BASE}${HEADER_ID_SUFFIX}" - if [[ $(grep -cE "^#(ifndef|define) ${HEADER_ID}" "${HEADER_FILE}") != 2 ]]; then + if [[ $(grep --count --extended-regexp "^#(ifndef|define|endif //) ${HEADER_ID}" "${HEADER_FILE}") != 3 ]]; then echo "${HEADER_FILE} seems to be missing the expected include guard:" echo " #ifndef ${HEADER_ID}" echo " #define ${HEADER_ID}"