mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-01 16:53:52 +02:00
validation: clarify final |= BLOCK_FAILED_VALID in InvalidateBlock
This has no functional affect, as the any CBlockIndex*s which to_mark_failed is set to will already have been marked failed. Also prevents a situation where block already marked as BLOCK_FAILED_CHILD is again unconditionally marked as BLOCK_FAILED_VALID in the final |= BLOCK_FAILED_VALID.
This commit is contained in:
committed by
stratospher
parent
aac5488909
commit
3c3548a70e
@@ -147,6 +147,11 @@ BOOST_FIXTURE_TEST_CASE(invalidate_block, TestChain100Setup)
|
||||
WITH_LOCK(::cs_main, assert(pindex->nStatus & BLOCK_FAILED_CHILD));
|
||||
pindex = pindex->pprev;
|
||||
}
|
||||
|
||||
// don't mark already invalidated block (orig_tip is BLOCK_FAILED_CHILD) with BLOCK_FAILED_VALID again
|
||||
m_node.chainman->ActiveChainstate().InvalidateBlock(state, orig_tip);
|
||||
WITH_LOCK(::cs_main, assert(orig_tip->nStatus & BLOCK_FAILED_CHILD));
|
||||
WITH_LOCK(::cs_main, assert((orig_tip->nStatus & BLOCK_FAILED_VALID) == 0));
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
|
||||
Reference in New Issue
Block a user