From 65571c36a265ec340343b555d1537c58ab335538 Mon Sep 17 00:00:00 2001 From: TheCharlatan Date: Tue, 28 May 2024 20:58:48 +0200 Subject: [PATCH] kernel: Add chainstate manager object to C header This is the main driver class for anything validation related, so expose it here. Creating the chainstate manager options will currently also trigger the creation of their respectively configured directories. The chainstate manager and block manager options are consolidated into a single object. The kernel might eventually introduce a separate block manager object for the purposes of being a light-weight block store reader. The chainstate manager will associate with the context with which it was created for the duration of its lifetime and it keeps it in memory with a shared pointer. The tests now also create dedicated temporary directories. This is similar to the behaviour in the existing unit test framework. Co-authored-by: stickies-v --- src/kernel/bitcoinkernel.cpp | 87 ++++++++++++++++++++++++++++++ src/kernel/bitcoinkernel.h | 72 +++++++++++++++++++++++++ src/kernel/bitcoinkernel_wrapper.h | 19 +++++++ src/test/kernel/test_kernel.cpp | 70 ++++++++++++++++++++++++ test/lint/test_runner/src/main.rs | 1 + 5 files changed, 249 insertions(+) diff --git a/src/kernel/bitcoinkernel.cpp b/src/kernel/bitcoinkernel.cpp index 2670287ab4a..445ccca94df 100644 --- a/src/kernel/bitcoinkernel.cpp +++ b/src/kernel/bitcoinkernel.cpp @@ -7,6 +7,7 @@ #include #include +#include #include #include #include @@ -14,6 +15,7 @@ #include #include #include +#include #include #include