mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-12 15:02:36 +02:00
validation: Move PruneOneBlockFile to BlockManager
[META] This is a pure refactor commit. Move PruneBlockFile to BlockManager because: 1. PruneOneBlockFile only acts on BlockManager 2. Eliminates the need for callers (FindFilesToPrune{,Manual}) to have a reference to the larger ChainstateManager, just a reference to BlockManager is enough. See following commits.
This commit is contained in:
@ -126,7 +126,7 @@ BOOST_FIXTURE_TEST_CASE(scan_for_wallet_transactions, TestChain100Setup)
|
||||
// Prune the older block file.
|
||||
{
|
||||
LOCK(cs_main);
|
||||
Assert(m_node.chainman)->PruneOneBlockFile(oldTip->GetBlockPos().nFile);
|
||||
Assert(m_node.chainman)->m_blockman.PruneOneBlockFile(oldTip->GetBlockPos().nFile);
|
||||
}
|
||||
UnlinkPrunedFiles({oldTip->GetBlockPos().nFile});
|
||||
|
||||
@ -152,7 +152,7 @@ BOOST_FIXTURE_TEST_CASE(scan_for_wallet_transactions, TestChain100Setup)
|
||||
// Prune the remaining block file.
|
||||
{
|
||||
LOCK(cs_main);
|
||||
Assert(m_node.chainman)->PruneOneBlockFile(newTip->GetBlockPos().nFile);
|
||||
Assert(m_node.chainman)->m_blockman.PruneOneBlockFile(newTip->GetBlockPos().nFile);
|
||||
}
|
||||
UnlinkPrunedFiles({newTip->GetBlockPos().nFile});
|
||||
|
||||
@ -189,7 +189,7 @@ BOOST_FIXTURE_TEST_CASE(importmulti_rescan, TestChain100Setup)
|
||||
// Prune the older block file.
|
||||
{
|
||||
LOCK(cs_main);
|
||||
Assert(m_node.chainman)->PruneOneBlockFile(oldTip->GetBlockPos().nFile);
|
||||
Assert(m_node.chainman)->m_blockman.PruneOneBlockFile(oldTip->GetBlockPos().nFile);
|
||||
}
|
||||
UnlinkPrunedFiles({oldTip->GetBlockPos().nFile});
|
||||
|
||||
|
Reference in New Issue
Block a user