mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 06:28:31 +01:00
Merge #20750: [Bundle 2/n] Prune g_chainman usage in mempool-related validation functions
e8ae1db864style-only: Make AcceptToMemoryPool signature readable (Carl Dong)8f5c100064style-only: Make CheckSequenceLock signature readable (Carl Dong)8c824819c8validation: Use *this in CChainState::LoadMempool (Carl Dong)0a9a24d8c7validation: Pass in chainstate to UpdateMempoolForReorg (Carl Dong)7142018812validation: Pass in chainstate to CTxMemPool::removeForReorg (Carl Dong)71734c65dcvalidation: Pass in chain to ::TestLockPointValidity (Carl Dong)120aaba9actree-wide: Fix erroneous AcceptToMemoryPool replacements (Carl Dong)417dafc1eevalidation: Remove old AcceptToMemoryPool w/o chainstate param (Carl Dong)3704433c4fscripted-diff: Invoke ::AcceptToMemoryPool with chainstate (Carl Dong)229bc37b5fvalidation: Pass in chainstate to ::AcceptToMemoryPool (Carl Dong)d0da7ea57avalidation: Pass in chainstate to ::LoadMempool (Carl Dong)3a205c43dcvalidation: Pass in chainstate to AcceptToMemoryPoolWithTime (Carl Dong)d8a816329cvalidation: Add chainstate member to MemPoolAccept (Carl Dong)4c15942b79validation: Pass in chainstate to ::CheckSequenceLocks (Carl Dong)577b774d0cvalidation: Remove old CheckFinalTx w/o chain tip param (Carl Dong)7031cf89dbscripted-diff: Invoke ::CheckFinalTx with chain tip (Carl Dong)d015eaa550validation: Pass in chain tip to ::CheckFinalTx (Carl Dong)252b489c9fvalidation: Pass in coins tip to CheckInputsFromMempoolAndCache (Carl Dong)73a6d2b7bevalidation: Pass in chainstate to IsCurrentForFeeEstimation (Carl Dong)d1f932b0b0validation: Pass in coins cache to ::LimitMempoolSize (Carl Dong) Pull request description: Overall PR: #20158 (tree-wide: De-globalize ChainstateManager) Note to reviewers: 1. This bundle may _apparently_ introduce usage of `g_chainman` or `::Chain(state|)Active()` globals, but these are resolved later on in the overall PR. [Commits of overall PR](https://github.com/bitcoin/bitcoin/pull/20158/commits) 2. There may be seemingly obvious local references to `ChainstateManager` or other validation objects which are not being used in callers of the current function in question, this is done intentionally to **_keep each commit centered around one function/method_** to ease review and to make the overall change systematic. We don't assume anything about our callers. Rest assured that once we are considering that particular caller in later commits, we will use the obvious local references. [Commits of overall PR](https://github.com/bitcoin/bitcoin/pull/20158/commits) 3. When changing a function/method that has many callers (e.g. `LookupBlockIndex` with 55 callers), it is sometimes easier (and less error-prone) to use a scripted-diff. When doing so, there will be 3 commits in sequence so that every commit compiles like so: 1. Add `new_function`, make `old_function` a wrapper of `new_function`, divert all calls to `old_function` to `new_function` **in the local module only** 2. Scripted-diff to divert all calls to `old_function` to `new_function` **in the rest of the codebase** 3. Remove `old_function` ACKs for top commit: glozow: reACKe8ae1db864via `git range-diff 15f0042...e8ae1db`, only change is fixing ATMP call from conflict MarcoFalke: ACKe8ae1db864📣 Tree-SHA512: 6af50f04940a69c5c3d3796a24f32f963fa02503cdc1155cc11fff832a99172b407cd163a19793080a5af98580f051b48195b62ec4a797ba2763b4883174153d
This commit is contained in:
@@ -273,7 +273,7 @@ BOOST_AUTO_TEST_CASE(mempool_locks_reorg)
|
||||
{
|
||||
LOCK(cs_main);
|
||||
for (const auto& tx : txs) {
|
||||
const MempoolAcceptResult result = AcceptToMemoryPool(*m_node.mempool, tx, false /* bypass_limits */);
|
||||
const MempoolAcceptResult result = AcceptToMemoryPool(::ChainstateActive(), *m_node.mempool, tx, false /* bypass_limits */);
|
||||
BOOST_REQUIRE(result.m_result_type == MempoolAcceptResult::ResultType::VALID);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user