mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-15 01:58:09 +02:00
validation: Remove stale BlockManager param in ContextualCheckBlockHeader
This commit is contained in:
@@ -4077,7 +4077,7 @@ arith_uint256 CalculateClaimedHeadersWork(std::span<const CBlockHeader> headers)
|
||||
* v0.12 and v0.15 (when no additional protection was in place) whereby an attacker could unboundedly
|
||||
* grow our in-memory block index. See https://bitcoincore.org/en/2024/07/03/disclose-header-spam.
|
||||
*/
|
||||
static bool ContextualCheckBlockHeader(const CBlockHeader& block, BlockValidationState& state, BlockManager& blockman, const ChainstateManager& chainman, const CBlockIndex* pindexPrev) EXCLUSIVE_LOCKS_REQUIRED(::cs_main)
|
||||
static bool ContextualCheckBlockHeader(const CBlockHeader& block, BlockValidationState& state, const ChainstateManager& chainman, const CBlockIndex* pindexPrev) EXCLUSIVE_LOCKS_REQUIRED(::cs_main)
|
||||
{
|
||||
AssertLockHeld(::cs_main);
|
||||
assert(pindexPrev != nullptr);
|
||||
@@ -4221,7 +4221,7 @@ bool ChainstateManager::AcceptBlockHeader(const CBlockHeader& block, BlockValida
|
||||
LogDebug(BCLog::VALIDATION, "header %s has prev block invalid: %s\n", hash.ToString(), block.hashPrevBlock.ToString());
|
||||
return state.Invalid(BlockValidationResult::BLOCK_INVALID_PREV, "bad-prevblk");
|
||||
}
|
||||
if (!ContextualCheckBlockHeader(block, state, m_blockman, *this, pindexPrev)) {
|
||||
if (!ContextualCheckBlockHeader(block, state, *this, pindexPrev)) {
|
||||
LogDebug(BCLog::VALIDATION, "%s: Consensus::ContextualCheckBlockHeader: %s, %s\n", __func__, hash.ToString(), state.ToString());
|
||||
return false;
|
||||
}
|
||||
@@ -4502,7 +4502,7 @@ BlockValidationState TestBlockValidity(
|
||||
* - do run ContextualCheckBlock()
|
||||
*/
|
||||
|
||||
if (!ContextualCheckBlockHeader(block, state, chainstate.m_blockman, chainstate.m_chainman, tip)) {
|
||||
if (!ContextualCheckBlockHeader(block, state, chainstate.m_chainman, tip)) {
|
||||
if (state.IsValid()) NONFATAL_UNREACHABLE();
|
||||
return state;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user