mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-08 14:47:31 +02:00
kernel: Add Handle/View pattern for BlockValidationState
Add C API functions for managing BlockValidationState lifecycle: - btck_block_validation_state_create() - btck_block_validation_state_copy() - btck_block_validation_state_destroy() Introduce BlockValidationStateApi<> template to share common getter methods between BlockValidationState (Handle) and BlockValidationStateView (View) classes in the C++ wrapper. This enables external code to create and own BlockValidationState objects needed for the new process_block_header() API. Co-authored-by: TheCharlatan <seb.kung@gmail.com>
This commit is contained in:
@@ -145,7 +145,7 @@ class TestValidationInterface : public ValidationInterface
|
||||
public:
|
||||
std::optional<std::vector<std::byte>> m_expected_valid_block = std::nullopt;
|
||||
|
||||
void BlockChecked(Block block, const BlockValidationState state) override
|
||||
void BlockChecked(Block block, BlockValidationStateView state) override
|
||||
{
|
||||
if (m_expected_valid_block.has_value()) {
|
||||
auto ser_block{block.ToBytes()};
|
||||
|
||||
Reference in New Issue
Block a user