Merge 141540a71f into merged_master (Bitcoin PR bitcoin/bitcoin#25222)

This commit is contained in:
Byron Hambly 2024-11-26 13:55:27 +02:00
commit d7ccdef889
4 changed files with 18 additions and 13 deletions

View file

@ -961,9 +961,9 @@ static std::optional<kernel::CCoinsStats> GetUTXOStats(CCoinsView* view, node::B
// Use CoinStatsIndex if it is requested and available and a hash_type of Muhash or None was requested
if ((hash_type == kernel::CoinStatsHashType::MUHASH || hash_type == kernel::CoinStatsHashType::NONE) && g_coin_stats_index && index_requested) {
if (pindex) {
return g_coin_stats_index->LookUpStats(pindex);
return g_coin_stats_index->LookUpStats(*pindex);
} else {
CBlockIndex* block_index = WITH_LOCK(::cs_main, return blockman.LookupBlockIndex(view->GetBestBlock()));
CBlockIndex& block_index = *CHECK_NONFATAL(WITH_LOCK(::cs_main, return blockman.LookupBlockIndex(view->GetBestBlock())));
return g_coin_stats_index->LookUpStats(block_index);
}
}