mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 14:59:39 -04:00
validation: Don't use IsValid() to filter for invalid blocks
IsValid() also returnis false for blocks that have not been validated yet up to the default validity level of BLOCK_VALID_TRANSACTIONS but are not marked as invalid - e.g. if we only know the header. Here, we specifically want to filter for invalid blocks.
This commit is contained in:
parent
b8de864852
commit
adcbb2a32e
1 changed files with 1 additions and 1 deletions
|
@ -3839,7 +3839,7 @@ void Chainstate::ResetBlockFailureFlags(CBlockIndex *pindex) {
|
|||
|
||||
// Remove the invalidity flag from this block and all its descendants and ancestors.
|
||||
for (auto& [_, block_index] : m_blockman.m_block_index) {
|
||||
if (!block_index.IsValid() && (block_index.GetAncestor(nHeight) == pindex || pindex->GetAncestor(block_index.nHeight) == &block_index)) {
|
||||
if ((block_index.nStatus & BLOCK_FAILED_MASK) && (block_index.GetAncestor(nHeight) == pindex || pindex->GetAncestor(block_index.nHeight) == &block_index)) {
|
||||
block_index.nStatus &= ~BLOCK_FAILED_MASK;
|
||||
m_blockman.m_dirty_blockindex.insert(&block_index);
|
||||
if (block_index.IsValid(BLOCK_VALID_TRANSACTIONS) && block_index.HaveNumChainTxs() && setBlockIndexCandidates.value_comp()(m_chain.Tip(), &block_index)) {
|
||||
|
|
Loading…
Add table
Reference in a new issue