aboutsummaryrefslogtreecommitdiff
path: root/src/index/coinstatsindex.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/index/coinstatsindex.cpp')
-rw-r--r--src/index/coinstatsindex.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/index/coinstatsindex.cpp b/src/index/coinstatsindex.cpp
index 5bc6ad3d31..d80885f842 100644
--- a/src/index/coinstatsindex.cpp
+++ b/src/index/coinstatsindex.cpp
@@ -19,9 +19,6 @@ using kernel::CCoinsStats;
using kernel::GetBogoSize;
using kernel::TxOutSer;
-using node::ReadBlockFromDisk;
-using node::UndoReadFromDisk;
-
static constexpr uint8_t DB_BLOCK_HASH{'s'};
static constexpr uint8_t DB_BLOCK_HEIGHT{'t'};
static constexpr uint8_t DB_MUHASH{'M'};
@@ -125,7 +122,7 @@ bool CoinStatsIndex::CustomAppend(const interfaces::BlockInfo& block)
// pindex variable gives indexing code access to node internals. It
// will be removed in upcoming commit
const CBlockIndex* pindex = WITH_LOCK(cs_main, return m_chainstate->m_blockman.LookupBlockIndex(block.hash));
- if (!UndoReadFromDisk(block_undo, pindex)) {
+ if (!m_chainstate->m_blockman.UndoReadFromDisk(block_undo, *pindex)) {
return false;
}
@@ -282,12 +279,11 @@ bool CoinStatsIndex::CustomRewind(const interfaces::BlockKey& current_tip, const
LOCK(cs_main);
const CBlockIndex* iter_tip{m_chainstate->m_blockman.LookupBlockIndex(current_tip.hash)};
const CBlockIndex* new_tip_index{m_chainstate->m_blockman.LookupBlockIndex(new_tip.hash)};
- const auto& consensus_params{Params().GetConsensus()};
do {
CBlock block;
- if (!ReadBlockFromDisk(block, iter_tip, consensus_params)) {
+ if (!m_chainstate->m_blockman.ReadBlockFromDisk(block, *iter_tip)) {
return error("%s: Failed to read block %s from disk",
__func__, iter_tip->GetBlockHash().ToString());
}
@@ -409,7 +405,7 @@ bool CoinStatsIndex::ReverseBlock(const CBlock& block, const CBlockIndex* pindex
// Ignore genesis block
if (pindex->nHeight > 0) {
- if (!UndoReadFromDisk(block_undo, pindex)) {
+ if (!m_chainstate->m_blockman.UndoReadFromDisk(block_undo, *pindex)) {
return false;
}