mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-09 05:14:22 +01:00
refactor: Prefer clean assert over UB in coinstats
This commit is contained in:
parent
ad4bf8a945
commit
fa8fffebe8
1 changed files with 2 additions and 1 deletions
|
@ -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);
|
||||||
|
|
Loading…
Add table
Reference in a new issue