refactoring: move ReplayBlocks under CChainState
This commit is contained in:
1 parent
bcf73d3b84
commit
3cf36736e5
3 files changed
+7
-12
No files matched your search
+4
-7
@@ -4091,13 +4091,14 @@ bool CChainState::RollforwardBlock(const CBlockIndex* pindex, CCoinsViewCache& i
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CChainState::ReplayBlocks(const CChainParams& params, CCoinsView* view)
|
||||
bool CChainState::ReplayBlocks(const CChainParams& params)
|
||||
{
|
||||
LOCK(cs_main);
|
||||
|
||||
CCoinsViewCache cache(view);
|
||||
CCoinsView& db = this->CoinsDB();
|
||||
CCoinsViewCache cache(&db);
|
||||
|
||||
std::vector<uint256> hashHeads = view->GetHeadBlocks();
|
||||
std::vector<uint256> hashHeads = db.GetHeadBlocks();
|
||||
if (hashHeads.empty()) return true; // We're already in a consistent state.
|
||||
if (hashHeads.size() != 2) return error("ReplayBlocks(): unknown inconsistent state");
|
||||
|
||||
@@ -4157,10 +4158,6 @@ bool CChainState::ReplayBlocks(const CChainParams& params, CCoinsView* view)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ReplayBlocks(const CChainParams& params, CCoinsView* view) {
|
||||
return ::ChainstateActive().ReplayBlocks(params, view);
|
||||
}
|
||||
|
||||
//! Helper for CChainState::RewindBlockIndex
|
||||
void CChainState::EraseBlockData(CBlockIndex* index)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user