mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-09 06:09:48 +02:00
refactor: Pass chainstate parameters to MaybeCompleteSnapshotValidation
Remove hardcoded references to m_ibd_chainstate and m_snapshot_chainstate so MaybeCompleteSnapshotValidation function can be simpler and focus on validating the snapshot without dealing with internal ChainstateManager states. This is a step towards being able to validate the snapshot outside of ActivateBestChain loop so cs_main is not locked for minutes when the snapshot block is connected.
This commit is contained in:
@@ -191,7 +191,7 @@ void utxo_snapshot_fuzz(FuzzBufferType buffer)
|
||||
const auto* index{chainman.m_blockman.LookupBlockIndex(block->GetHash())};
|
||||
Assert(index);
|
||||
Assert(index->nTx == 0);
|
||||
if (index->nHeight == chainman.GetSnapshotBaseHeight()) {
|
||||
if (index->nHeight == chainman.ActiveChainstate().SnapshotBase()->nHeight) {
|
||||
auto params{chainman.GetParams().AssumeutxoForHeight(index->nHeight)};
|
||||
Assert(params.has_value());
|
||||
Assert(params.value().m_chain_tx_count == index->m_chain_tx_count);
|
||||
|
||||
Reference in New Issue
Block a user