validation: export GetBlockScriptFlags()
What changed, and why it matters
This commit simply makes an internal helper function visible to other parts of the codebase. It does not change what the function does, what data it can access, or how Bitcoin validates blocks. There is no security issue here.
No action required. This is a benign refactoring change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch removes the static keyword from GetBlockScriptFlags() in src/validation.cpp and adds a corresponding declaration in src/validation.h. This is a pure visibility/export change: the function’s implementation, parameters, return type, and callers within validation.cpp are unchanged. No new attack surface is introduced because the function was already defined and used in the same translation unit; exporting it only allows other translation units to call it.
Changed components
src/validation.cppsrc/validation.hInspect captured patch +4 / −4
diff --git a/src/validation.cpp b/src/validation.cpp
index 7b7c8b2d..ae8e80aa 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -262,9 +262,6 @@ bool CheckSequenceLocksAtTip(CBlockIndex* tip,
return EvaluateSequenceLocks(index, {lock_points.height, lock_points.time});
}
-// Returns the script flags which should be checked for a given block
-static unsigned int GetBlockScriptFlags(const CBlockIndex& block_index, const ChainstateManager& chainman);
-
static void LimitMempoolSize(CTxMemPool& pool, CCoinsViewCache& coins_cache)
EXCLUSIVE_LOCKS_REQUIRED(::cs_main, pool.cs)
{
@@ -2328,7 +2325,7 @@ DisconnectResult Chainstate::DisconnectBlock(const CBlock& block, const CBlockIn
return fClean ? DISCONNECT_OK : DISCONNECT_UNCLEAN;
}
-static unsigned int GetBlockScriptFlags(const CBlockIndex& block_index, const ChainstateManager& chainman)
+unsigned int GetBlockScriptFlags(const CBlockIndex& block_index, const ChainstateManager& chainman)
{
const Consensus::Params& consensusparams = chainman.GetConsensus();
diff --git a/src/validation.h b/src/validation.h
index 6be6ae28..86329e95 100644
--- a/src/validation.h
+++ b/src/validation.h
@@ -1358,4 +1358,7 @@ bool IsBIP30Repeat(const CBlockIndex& block_index);
/** Identifies blocks which coinbase output was subsequently overwritten in the UTXO set (see BIP30) */
bool IsBIP30Unspendable(const uint256& block_hash, int block_height);
+// Returns the script flags which should be checked for a given block
+unsigned int GetBlockScriptFlags(const CBlockIndex& block_index, const ChainstateManager& chainman);
+
#endif // BITCOIN_VALIDATION_H
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.