For discussion of https://github.com/bitcoin/bitcoin/pull/24008/commits/c14ae132c5a5204a9a755c84c6de05fb30459221
- IF1:
if(!m_snapshot_chainstate)
=> useibd
- IF2:
if(m_blockman.LookupBlockIndex(blockhash) == nullptr)
=> usesnapshot
- This means we use the snapshot chainstate if we have not seen this block’s header yet, implied from it not being in
m_block_index
- This means we use the snapshot chainstate if we have not seen this block’s header yet, implied from it not being in
- IF3:
if (!m_snapshot_chainstate->m_chain.Contains(pblock)))
=> usesnapshot
- This means we use the snapshot chainstate if the block header is not part of the current best chain (included in
m_chain
) which can mean we have not validated the full block yet or the block is not part of the best chain after validation
- This means we use the snapshot chainstate if the block header is not part of the current best chain (included in
- FB: fallback => use
ibd