refactor: introduce a more general LockDirectories for init

No functional change. This is in preparation for adding additional directory
locks on startup.
This commit is contained in:
Cory Fields
2025-01-15 18:03:43 +00:00
parent 1db331ba76
commit cabb2e5c24
5 changed files with 25 additions and 22 deletions

View File

@@ -55,11 +55,11 @@ bool AppInitParameterInteraction(const ArgsManager& args);
*/
bool AppInitSanityChecks(const kernel::Context& kernel);
/**
* Lock bitcoin core data directory.
* Lock bitcoin core critical directories.
* @note This should only be done after daemonization. Do not call Shutdown() if this function fails.
* @pre Parameters should be parsed and config file should be read, AppInitSanityChecks should have been called.
*/
bool AppInitLockDataDirectory();
bool AppInitLockDirectories();
/**
* Initialize node and wallet interface pointers. Has no prerequisites or side effects besides allocating memory.
*/
@@ -67,7 +67,7 @@ bool AppInitInterfaces(node::NodeContext& node);
/**
* Bitcoin core main initialization.
* @note This should only be done after daemonization. Call Shutdown() if this function fails.
* @pre Parameters should be parsed and config file should be read, AppInitLockDataDirectory should have been called.
* @pre Parameters should be parsed and config file should be read, AppInitLockDirectories should have been called.
*/
bool AppInitMain(node::NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info = nullptr);