mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-05-13 05:10:44 +02:00
validation: insert assumed-valid block index entries into candidates
This commit is contained in:
parent
01a9b8fe71
commit
5a807736da
@ -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))
|
||||||
|
@ -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;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user