aboutsummaryrefslogtreecommitdiff
path: root/src/rpc
diff options
context:
space:
mode:
authorMacroFake <falke.marco@gmail.com>2022-05-26 17:06:07 +0200
committerMacroFake <falke.marco@gmail.com>2022-07-20 07:59:53 +0200
commitfaa3d38ec6f2999740486c6c66cd062e74c769fb (patch)
tree2e64ae9bd4df10bbd90b13709b04f5f26271b59c /src/rpc
parent0897b189e4242321cd03339e7dde5c4d963d0e48 (diff)
downloadbitcoin-faa3d38ec6f2999740486c6c66cd062e74c769fb.tar.xz
refactor: Pass reference to LookUpStats
Diffstat (limited to 'src/rpc')
-rw-r--r--src/rpc/blockchain.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp
index 88ceeadea4..750b57262d 100644
--- a/src/rpc/blockchain.cpp
+++ b/src/rpc/blockchain.cpp
@@ -832,9 +832,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);
}
}