diff options
author | MacroFake <falke.marco@gmail.com> | 2022-05-26 17:06:07 +0200 |
---|---|---|
committer | MacroFake <falke.marco@gmail.com> | 2022-07-20 07:59:53 +0200 |
commit | faa3d38ec6f2999740486c6c66cd062e74c769fb (patch) | |
tree | 2e64ae9bd4df10bbd90b13709b04f5f26271b59c /src/rpc | |
parent | 0897b189e4242321cd03339e7dde5c4d963d0e48 (diff) | |
download | bitcoin-faa3d38ec6f2999740486c6c66cd062e74c769fb.tar.xz |
refactor: Pass reference to LookUpStats
Diffstat (limited to 'src/rpc')
-rw-r--r-- | src/rpc/blockchain.cpp | 4 |
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); } } |