aboutsummaryrefslogtreecommitdiff
path: root/src/validation.cpp
diff options
context:
space:
mode:
authorJames O'Beirne <james.obeirne@gmail.com>2019-03-29 16:43:59 -0400
committerJames O'Beirne <james.obeirne@gmail.com>2019-09-17 09:45:38 -0400
commit3cf36736e540cf06250701f0934a7946836d000d (patch)
tree28a1cd25fa20c38938df353962ed39f1fee51701 /src/validation.cpp
parentbcf73d3b84649c8786f0cccc6862dd1bbdb9950b (diff)
refactoring: move ReplayBlocks under CChainState
Diffstat (limited to 'src/validation.cpp')
-rw-r--r--src/validation.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/validation.cpp b/src/validation.cpp
index 60baebccfd..3a35fd510a 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -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)
{