mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-09-12 21:52:53 +02:00
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:
@@ -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()};
|
||||
|
||||
Reference in New Issue
Block a user