I think the main thing here is to have a name that clearly indicates that this contains “only the common initialization code that the kernel needs” so that people don’t accidentally add non-kernel code to it (it would result in a linker error when building bitcoin-chainstate
).
Other PRs in the project (e.g. #24410) does this as well, since “extracting only what the kernel needs” is the main goal of this phase of the project. I like using the kernel/
prefix since it makes the indication mentioned in the previous paragraph clear, and doesn’t require inventing a new name.
In this particular case though, perhaps kernel/init.cpp
would work.
One question is: do we keep the two functions moved in the init::
namespace or the kernel::
namespace.
In the longer run, I think eventually (very far off when libbitcoinkernel
is very minimal) we could put everything that links into libbitcoinkernel into the src/kernel/
folder.