From 337ea860dfda12dac084209027a54fba857e7a89 Mon Sep 17 00:00:00 2001 From: TheCharlatan Date: Mon, 3 Jun 2024 14:35:47 +0200 Subject: [PATCH] kernel: Add kernel library context object The context introduced here holds the objects that will be required for running validation tasks, such as the chosen chain parameters, callbacks for validation events, and interrupt handling. These will be used by the chainstate manager introduced in subsequent commits. This commit also introduces conventions for defining option objects. A common pattern throughout the C header will be: ``` options = object_option_create(); object = object_create(options); ``` This allows for more consistent usage of a "builder pattern" for objects where options can be configured independently from instantiation. --- src/kernel/bitcoinkernel.cpp | 66 ++++++++++++++++++++++++++ src/kernel/bitcoinkernel.h | 74 ++++++++++++++++++++++++++++++ src/kernel/bitcoinkernel_wrapper.h | 16 +++++++ src/test/kernel/test_kernel.cpp | 14 ++++++ 4 files changed, 170 insertions(+) diff --git a/src/kernel/bitcoinkernel.cpp b/src/kernel/bitcoinkernel.cpp index 4aa2c176d88..8f29ac81636 100644 --- a/src/kernel/bitcoinkernel.cpp +++ b/src/kernel/bitcoinkernel.cpp @@ -7,8 +7,11 @@ #include #include +#include +#include #include #include +#include #include #include #include