aboutsummaryrefslogtreecommitdiff
path: root/src/node/coinstats.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/node/coinstats.cpp')
-rw-r--r--src/node/coinstats.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/node/coinstats.cpp b/src/node/coinstats.cpp
index eacd7e2ab5..38c1d29250 100644
--- a/src/node/coinstats.cpp
+++ b/src/node/coinstats.cpp
@@ -104,9 +104,9 @@ static bool GetUTXOStats(CCoinsView* view, BlockManager& blockman, CCoinsStats&
stats.nHeight = Assert(pindex)->nHeight;
stats.hashBlock = pindex->GetBlockHash();
- // Use CoinStatsIndex if it is available and a hash_type of Muhash or None was requested
- if ((stats.m_hash_type == CoinStatsHashType::MUHASH || stats.m_hash_type == CoinStatsHashType::NONE) && g_coin_stats_index) {
- stats.from_index = true;
+ // Use CoinStatsIndex if it is requested and available and a hash_type of Muhash or None was requested
+ if ((stats.m_hash_type == CoinStatsHashType::MUHASH || stats.m_hash_type == CoinStatsHashType::NONE) && g_coin_stats_index && stats.index_requested) {
+ stats.index_used = true;
return g_coin_stats_index->LookUpStats(pindex, stats);
}