mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
Move block-arrival information / preciousblock counters to ChainstateManager
Block arrival information (and the preciousblock RPC, a related concept) are both chainstate-agnostic, so these are moved to ChainstateManager. This should just be a refactor, without any observable behavior changes.
This commit is contained in:
@@ -433,9 +433,13 @@ BOOST_FIXTURE_TEST_CASE(chainstatemanager_loadblockindex, TestChain100Setup)
|
||||
CBlockIndex* assumed_tip{WITH_LOCK(chainman.GetMutex(), return chainman.ActiveChain().Tip())};
|
||||
|
||||
auto reload_all_block_indexes = [&]() {
|
||||
// For completeness, we also reset the block sequence counters to
|
||||
// ensure that no state which affects the ranking of tip-candidates is
|
||||
// retained (even though this isn't strictly necessary).
|
||||
WITH_LOCK(::cs_main, return chainman.ResetBlockSequenceCounters());
|
||||
for (Chainstate* cs : chainman.GetAll()) {
|
||||
LOCK(::cs_main);
|
||||
cs->UnloadBlockIndex();
|
||||
cs->ClearBlockIndexCandidates();
|
||||
BOOST_CHECK(cs->setBlockIndexCandidates.empty());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user