@@ -93,7 +93,7 @@ static void ApplyStats(CCoinsStats& stats, const uint256& hash, const std::map<u
9393
9494// ! Calculate statistics about the unspent transaction output set
9595template <typename T>
96- static bool GetUTXOStats (CCoinsView* view, BlockManager& blockman, CCoinsStats& stats, T hash_obj, const std::function<void ()>& interruption_point, const CBlockIndex* pindex, CoinStatsHashType& hash_type)
96+ static bool GetUTXOStats (CCoinsView* view, BlockManager& blockman, CCoinsStats& stats, T hash_obj, const std::function<void ()>& interruption_point, const CBlockIndex* pindex, CoinStatsHashType& hash_type, bool index_requested )
9797{
9898 std::unique_ptr<CCoinsViewCursor> pcursor (view->Cursor ());
9999 assert (pcursor);
@@ -106,7 +106,7 @@ static bool GetUTXOStats(CCoinsView* view, BlockManager& blockman, CCoinsStats&
106106 stats.hashBlock = pindex->GetBlockHash ();
107107
108108 // Use CoinStatsIndex if it is requested and available and a hash_type of Muhash or None was requested
109- if ((hash_type == CoinStatsHashType::MUHASH || hash_type == CoinStatsHashType::NONE) && g_coin_stats_index && stats. index_requested ) {
109+ if ((hash_type == CoinStatsHashType::MUHASH || hash_type == CoinStatsHashType::NONE) && g_coin_stats_index && index_requested) {
110110 stats.index_used = true ;
111111 return g_coin_stats_index->LookUpStats (pindex, stats);
112112 }
@@ -144,19 +144,19 @@ static bool GetUTXOStats(CCoinsView* view, BlockManager& blockman, CCoinsStats&
144144 return true ;
145145}
146146
147- bool GetUTXOStats (CCoinsView* view, BlockManager& blockman, CCoinsStats& stats, CoinStatsHashType hash_type, const std::function<void ()>& interruption_point, const CBlockIndex* pindex)
147+ bool GetUTXOStats (CCoinsView* view, BlockManager& blockman, CCoinsStats& stats, CoinStatsHashType hash_type, const std::function<void ()>& interruption_point, const CBlockIndex* pindex, bool index_requested )
148148{
149149 switch (hash_type) {
150150 case (CoinStatsHashType::HASH_SERIALIZED): {
151151 CHashWriter ss (SER_GETHASH, PROTOCOL_VERSION);
152- return GetUTXOStats (view, blockman, stats, ss, interruption_point, pindex, hash_type);
152+ return GetUTXOStats (view, blockman, stats, ss, interruption_point, pindex, hash_type, index_requested );
153153 }
154154 case (CoinStatsHashType::MUHASH): {
155155 MuHash3072 muhash;
156- return GetUTXOStats (view, blockman, stats, muhash, interruption_point, pindex, hash_type);
156+ return GetUTXOStats (view, blockman, stats, muhash, interruption_point, pindex, hash_type, index_requested );
157157 }
158158 case (CoinStatsHashType::NONE): {
159- return GetUTXOStats (view, blockman, stats, nullptr , interruption_point, pindex, hash_type);
159+ return GetUTXOStats (view, blockman, stats, nullptr , interruption_point, pindex, hash_type, index_requested );
160160 }
161161 } // no default case, so the compiler can warn about missing cases
162162 assert (false );
0 commit comments