Skip to content

Commit f27629f

Browse files
committed
fuzz: InvalidateBlock, ResetBlockFailureFlags
1 parent 2f4f5da commit f27629f

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/test/fuzz/block_index_tree.cpp

+13
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,19 @@ FUZZ_TARGET(block_index_tree, .init = initialize_block_index_tree)
168168
}
169169
}
170170
}
171+
},
172+
[&] {
173+
// InvalidateBlock
174+
CBlockIndex* prev_block = PickValue(fuzzed_data_provider, blocks);
175+
BlockValidationState state;
176+
bool ret = chainman.ActiveChainstate().InvalidateBlock(state, prev_block);
177+
assert(ret);
178+
},
179+
[&] {
180+
// ReconsiderBlock
181+
LOCK(cs_main);
182+
CBlockIndex* prev_block = PickValue(fuzzed_data_provider, blocks);
183+
chainman.ActiveChainstate().ResetBlockFailureFlags(prev_block);
171184
});
172185
}
173186
chainman.CheckBlockIndex();

0 commit comments

Comments
 (0)