validation: insert assumed-valid block index entries into candidates
This commit is contained in:
2 files changed
+7
-4
No files matched your search
+3
-1
@@ -3773,7 +3773,9 @@ bool BlockManager::LoadBlockIndex(
|
|||||||
pindex->nStatus |= BLOCK_FAILED_CHILD;
|
pindex->nStatus |= BLOCK_FAILED_CHILD;
|
||||||
setDirtyBlockIndex.insert(pindex);
|
setDirtyBlockIndex.insert(pindex);
|
||||||
}
|
}
|
||||||
if (pindex->IsValid(BLOCK_VALID_TRANSACTIONS) && (pindex->HaveTxsDownloaded() || pindex->pprev == nullptr)) {
|
if (pindex->IsAssumedValid() ||
|
||||||
|
(pindex->IsValid(BLOCK_VALID_TRANSACTIONS) &&
|
||||||
|
(pindex->HaveTxsDownloaded() || pindex->pprev == nullptr))) {
|
||||||
block_index_candidates.insert(pindex);
|
block_index_candidates.insert(pindex);
|
||||||
}
|
}
|
||||||
if (pindex->nStatus & BLOCK_FAILED_MASK && (!pindexBestInvalid || pindex->nChainWork > pindexBestInvalid->nChainWork))
|
if (pindex->nStatus & BLOCK_FAILED_MASK && (!pindexBestInvalid || pindex->nChainWork > pindexBestInvalid->nChainWork))
|
||||||
|
|||||||
+4
-3
@@ -647,9 +647,10 @@ public:
|
|||||||
const std::optional<uint256> m_from_snapshot_blockhash;
|
const std::optional<uint256> m_from_snapshot_blockhash;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The set of all CBlockIndex entries with BLOCK_VALID_TRANSACTIONS (for itself and all ancestors) and
|
* The set of all CBlockIndex entries with either BLOCK_VALID_TRANSACTIONS (for
|
||||||
* as good as our current tip or better. Entries may be failed, though, and pruning nodes may be
|
* itself and all ancestors) *or* BLOCK_ASSUMED_VALID (if using background
|
||||||
* missing the data for the block.
|
* chainstates) and as good as our current tip or better. Entries may be failed,
|
||||||
|
* though, and pruning nodes may be missing the data for the block.
|
||||||
*/
|
*/
|
||||||
std::set<CBlockIndex*, CBlockIndexWorkComparator> setBlockIndexCandidates;
|
std::set<CBlockIndex*, CBlockIndexWorkComparator> setBlockIndexCandidates;
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user