mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 15:09:59 +01:00
refactor: Prefer clean assert over UB in coinstats
This commit is contained in:
@@ -94,7 +94,8 @@ static bool GetUTXOStats(CCoinsView* view, BlockManager& blockman, CCoinsStats&
|
|||||||
{
|
{
|
||||||
LOCK(cs_main);
|
LOCK(cs_main);
|
||||||
assert(std::addressof(g_chainman.m_blockman) == std::addressof(blockman));
|
assert(std::addressof(g_chainman.m_blockman) == std::addressof(blockman));
|
||||||
stats.nHeight = blockman.LookupBlockIndex(stats.hashBlock)->nHeight;
|
const CBlockIndex* block = blockman.LookupBlockIndex(stats.hashBlock);
|
||||||
|
stats.nHeight = Assert(block)->nHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
PrepareHash(hash_obj, stats);
|
PrepareHash(hash_obj, stats);
|
||||||
|
|||||||
Reference in New Issue
Block a user