Skip to content

Commit 438ac29

Browse files
maakuglozow
authored andcommitted
snapshots: don't core dump when running -checkblockindex after loadtxoutset
Github-Pull: #28791 Rebased-From: cdc6ac4
1 parent 7ec3455 commit 438ac29

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
@@ -4850,7 +4850,9 @@ void ChainstateManager::CheckBlockIndex()
48504850
// For testing, allow transaction counts to be completely unset.
48514851
|| (pindex->nChainTx == 0 && pindex->nTx == 0)
48524852
// For testing, allow this nChainTx to be unset if previous is also unset.
4853-
|| (pindex->nChainTx == 0 && prev_chain_tx == 0 && pindex->pprev));
4853+
|| (pindex->nChainTx == 0 && prev_chain_tx == 0 && pindex->pprev)
4854+
// Transaction counts prior to snapshot are unknown.
4855+
|| pindex->IsAssumedValid());
48544856

48554857
if (pindexFirstAssumeValid == nullptr && pindex->nStatus & BLOCK_ASSUMED_VALID) pindexFirstAssumeValid = pindex;
48564858
if (pindexFirstInvalid == nullptr && pindex->nStatus & BLOCK_FAILED_VALID) pindexFirstInvalid = pindex;

0 commit comments

Comments
 (0)