Split non/kernel chainparams

Moves chainparams code not using the ArgsManager to the kernel.

Subsequently use the kernel chainparams header now where possible in
order to further decouple chainparams call sites from gArgs.
This commit is contained in:
Carl Dong
2022-03-10 22:13:58 -05:00
committed by TheCharlatan
parent edabbc78a3
commit 382b692a50
10 changed files with 732 additions and 673 deletions

View File

@@ -11,6 +11,7 @@
//
// It is part of the libbitcoinkernel project.
#include <kernel/chainparams.h>
#include <kernel/checks.h>
#include <kernel/context.h>
#include <kernel/validation_cache_sizes.h>
@@ -52,7 +53,7 @@ int main(int argc, char* argv[])
// SETUP: Misc Globals
SelectParams(CBaseChainParams::MAIN);
const CChainParams& chainparams = Params();
auto chainparams = CChainParams::Main();
kernel::Context kernel_context{};
// We can't use a goto here, but we can use an assert since none of the
@@ -81,7 +82,7 @@ int main(int argc, char* argv[])
// SETUP: Chainstate
const ChainstateManager::Options chainman_opts{
.chainparams = chainparams,
.chainparams = *chainparams,
.datadir = gArgs.GetDataDirNet(),
.adjusted_time_callback = NodeClock::now,
};