kernel: Return btck_BlockValidationState from process_block_header API

Remove redundant int return from btck_chainstate_manager_process_block_header.
Previously returned both an int result and an output validation state parameter, creating ambiguity
where non-zero could mean either invalid header or processing failure. Since ProcessNewBlockHeaders
already provides complete validation info, the int return was redundant.

Co-authored-by: stringintech <stringintech@gmail.com>
Co-authored-by: stickies-v <stickies-v@protonmail.com>
Co-authored-by: Hodlinator <172445034+hodlinator@users.noreply.github.com>
This commit is contained in:
yuvicc
2026-05-18 19:28:09 +05:30
parent d4bc620ad8
commit 88d9bc5aa4
4 changed files with 18 additions and 17 deletions

View File

@@ -1013,10 +1013,9 @@ BOOST_AUTO_TEST_CASE(btck_chainman_regtest_tests)
for (const auto& data : REGTEST_BLOCK_DATA) {
Block block{hex_string_to_byte_vec(data)};
BlockHeader header = block.GetHeader();
BlockValidationState state{};
BOOST_CHECK(state.GetBlockValidationResult() == BlockValidationResult::UNSET);
BOOST_CHECK(chainman->ProcessBlockHeader(header, state));
BlockValidationState state = chainman->ProcessBlockHeader(header);
BOOST_CHECK(state.GetValidationMode() == ValidationMode::VALID);
BOOST_CHECK(state.GetBlockValidationResult() == BlockValidationResult::UNSET);
BlockTreeEntry entry{*chainman->GetBlockTreeEntry(header.Hash())};
BOOST_CHECK(!chainman->GetChain().Contains(entry));
BlockTreeEntry best_entry{chainman->GetBestEntry()};