diff options
author | Mark Friedenbach <mark@friedenbach.org> | 2023-11-04 12:32:17 -0700 |
---|---|---|
committer | Mark Friedenbach <mark@friedenbach.org> | 2023-11-04 12:32:17 -0700 |
commit | cdc6ac4126b31426261605a757c52ea2dbfb2a81 (patch) | |
tree | f2f0c27c736667986d982b06bef2732b11b1ecf1 /src/validation.cpp | |
parent | d9007f51a7480246abe4c16f2e3d190988470bec (diff) |
snapshots: don't core dump when running -checkblockindex after `loadtxoutset`
Diffstat (limited to 'src/validation.cpp')
-rw-r--r-- | src/validation.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/validation.cpp b/src/validation.cpp index 8d7e366125..aa603a851d 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -4859,7 +4859,9 @@ void ChainstateManager::CheckBlockIndex() // For testing, allow transaction counts to be completely unset. || (pindex->nChainTx == 0 && pindex->nTx == 0) // For testing, allow this nChainTx to be unset if previous is also unset. - || (pindex->nChainTx == 0 && prev_chain_tx == 0 && pindex->pprev)); + || (pindex->nChainTx == 0 && prev_chain_tx == 0 && pindex->pprev) + // Transaction counts prior to snapshot are unknown. + || pindex->IsAssumedValid()); if (pindexFirstAssumeValid == nullptr && pindex->nStatus & BLOCK_ASSUMED_VALID) pindexFirstAssumeValid = pindex; if (pindexFirstInvalid == nullptr && pindex->nStatus & BLOCK_FAILED_VALID) pindexFirstInvalid = pindex; |