mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-02 09:15:04 +02:00
Merge #21270: [Bundle 4/n] Prune g_chainman usage in validation-adjacent modules
a67983cd6dnet_processing: Add review-only assertion to PeerManager (Carl Dong)272d993e75scripted-diff: net_processing: Use existing chainman (Carl Dong)021a04a469net_processing: Move some static functions to PeerManager (Carl Dong)91c5b68acdnode/ifaces: ChainImpl: Use existing NodeContext member (Carl Dong)8a1d580b21node/ifaces: NodeImpl: Use existing NodeContext member (Carl Dong)4cde4a701bnode: Use existing NodeContext (Carl Dong)106bcd4f39node/coinstats: Pass in BlockManager to GetUTXOStats (Carl Dong)2c3ba00693miner: Pass in blockman to ::RegenerateCommitments (Carl Dong)2afcf24408miner: Remove old CreateNewBlock w/o chainstate param (Carl Dong)46b7f29340scripted-diff: Invoke CreateNewBlock with chainstate (Carl Dong)d0de61b764miner: Pass in chainstate to BlockAssembler::CreateNewBlock (Carl Dong)a04aac493fvalidation: Remove extraneous LoadGenesisBlock function prototype (Carl Dong) Pull request description: Overall PR: #20158 (tree-wide: De-globalize ChainstateManager) Based on: - [x] #21055 | [Bundle 3/n] Prune g_chainman usage in mempool-related validation functions 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: laanwj: Code review ACKa67983cd6dryanofsky: Code review ACKa67983cd6d. Only change since last review new first commit fixing header declaration, and rebase glozow: code review ACKa67983cd6dTree-SHA512: dce182a18b88be80cbf50978d4ba8fa6ab0f01e861d09bae0ae9364051bb78f9334859d164b185b07f1d70a583e739557fab6d820cac8c37b3855b85c2a6771b
This commit is contained in:
@@ -264,7 +264,7 @@ FUZZ_TARGET_INIT(coins_view, initialize_coins_view)
|
||||
CCoinsStats stats;
|
||||
bool expected_code_path = false;
|
||||
try {
|
||||
(void)GetUTXOStats(&coins_view_cache, stats, CoinStatsHashType::HASH_SERIALIZED);
|
||||
(void)GetUTXOStats(&coins_view_cache, WITH_LOCK(::cs_main, return std::ref(g_chainman.m_blockman)), stats, CoinStatsHashType::HASH_SERIALIZED);
|
||||
} catch (const std::logic_error&) {
|
||||
expected_code_path = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user