Skip to content

Commit cdc6ac4

Browse files
committed
snapshots: don't core dump when running -checkblockindex after loadtxoutset
1 parent d9007f5 commit cdc6ac4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/validation.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4859,7 +4859,9 @@ void ChainstateManager::CheckBlockIndex()
48594859
// For testing, allow transaction counts to be completely unset.
48604860
|| (pindex->nChainTx == 0 && pindex->nTx == 0)
48614861
// For testing, allow this nChainTx to be unset if previous is also unset.
4862-
|| (pindex->nChainTx == 0 && prev_chain_tx == 0 && pindex->pprev));
4862+
|| (pindex->nChainTx == 0 && prev_chain_tx == 0 && pindex->pprev)
4863+
// Transaction counts prior to snapshot are unknown.
4864+
|| pindex->IsAssumedValid());
48634865

48644866
if (pindexFirstAssumeValid == nullptr && pindex->nStatus & BLOCK_ASSUMED_VALID) pindexFirstAssumeValid = pindex;
48654867
if (pindexFirstInvalid == nullptr && pindex->nStatus & BLOCK_FAILED_VALID) pindexFirstInvalid = pindex;

0 commit comments

Comments
 (0)