Skip to content

Commit 43a85fe

Browse files
committed
test: add check for BlockStatus of invalidated block
check that invalidated block has nStatus BLOCK_FAILED_VALID
1 parent 785d8f9 commit 43a85fe

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/test/interfaces_tests.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,9 @@ BOOST_AUTO_TEST_CASE(findCommonAncestor)
102102
auto* orig_tip = active.Tip();
103103
for (int i = 0; i < 10; ++i) {
104104
BlockValidationState state;
105-
m_node.chainman->ActiveChainstate().InvalidateBlock(state, active.Tip());
105+
auto* curr_tip = active.Tip();
106+
m_node.chainman->ActiveChainstate().InvalidateBlock(state, curr_tip);
107+
WITH_LOCK(::cs_main, assert(curr_tip->nStatus & BLOCK_FAILED_VALID));
106108
}
107109
BOOST_CHECK_EQUAL(active.Height(), orig_tip->nHeight - 10);
108110
coinbaseKey.MakeNewKey(true);

0 commit comments

Comments
 (0)