Move init::SanityCheck to kernel::SanityCheck

This commit is contained in:
Carl Dong
2022-05-27 16:47:05 -04:00
parent fed085a1a4
commit 265d6393bf
10 changed files with 68 additions and 30 deletions

View File

@@ -11,12 +11,12 @@
//
// It is part of the libbitcoinkernel project.
#include <kernel/checks.h>
#include <kernel/context.h>
#include <chainparams.h>
#include <consensus/validation.h>
#include <core_io.h>
#include <init/common.h>
#include <node/blockstorage.h>
#include <node/chainstate.h>
#include <scheduler.h>
@@ -26,6 +26,7 @@
#include <validation.h>
#include <validationinterface.h>
#include <cassert>
#include <filesystem>
#include <functional>
#include <iosfwd>
@@ -52,6 +53,10 @@ int main(int argc, char* argv[])
const CChainParams& chainparams = Params();
kernel::Context kernel_context{};
// We can't use a goto here, but we can use an assert since none of the
// things instantiated so far requires running the epilogue to be torn down
// properly
assert(kernel::SanityChecks(kernel_context));
// Necessary for CheckInputScripts (eventually called by ProcessNewBlock),
// which will try the script cache first and fall back to actually