@@ -93,7 +93,7 @@ static void ApplyStats(CCoinsStats& stats, const uint256& hash, const std::map<u
93
93
94
94
// ! Calculate statistics about the unspent transaction output set
95
95
template <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 )
97
97
{
98
98
std::unique_ptr<CCoinsViewCursor> pcursor (view->Cursor ());
99
99
assert (pcursor);
@@ -106,7 +106,7 @@ static bool GetUTXOStats(CCoinsView* view, BlockManager& blockman, CCoinsStats&
106
106
stats.hashBlock = pindex->GetBlockHash ();
107
107
108
108
// 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) {
110
110
stats.index_used = true ;
111
111
return g_coin_stats_index->LookUpStats (pindex, stats);
112
112
}
@@ -144,19 +144,19 @@ static bool GetUTXOStats(CCoinsView* view, BlockManager& blockman, CCoinsStats&
144
144
return true ;
145
145
}
146
146
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 )
148
148
{
149
149
switch (hash_type) {
150
150
case (CoinStatsHashType::HASH_SERIALIZED): {
151
151
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 );
153
153
}
154
154
case (CoinStatsHashType::MUHASH): {
155
155
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 );
157
157
}
158
158
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 );
160
160
}
161
161
} // no default case, so the compiler can warn about missing cases
162
162
assert (false );
0 commit comments