At this point, I don't see the benefit of this function anymore. Let's just inline it?
<details>
<summary>git diff on 436df349f0</summary>
diff --git a/src/init.cpp b/src/init.cpp
index 579669712e..3a984488af 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -1107,12 +1107,6 @@ static bool LockDirectory(const fs::path& dir, bool probeOnly)
} // no default case, so the compiler can warn about missing cases
assert(false);
}
-static bool LockDirectories(bool probeOnly)
-{
- // Only allow probing the blocks directory, the BlockManager takes the lock internally.
- return LockDirectory(gArgs.GetDataDirNet(), probeOnly) &&
- (probeOnly ? LockDirectory(gArgs.GetBlocksDirPath(), probeOnly) : true);
-}
bool AppInitSanityChecks(const kernel::Context& kernel)
{
@@ -1130,7 +1124,8 @@ bool AppInitSanityChecks(const kernel::Context& kernel)
// Probe the directory locks to give an early error message, if possible
// We cannot hold the directory locks here, as the forking for daemon() hasn't yet happened,
// and a fork will cause weird behavior to them.
- return LockDirectories(true);
+ return LockDirectory(gArgs.GetDataDirNet(), /*probeOnly=*/true)
+ && LockDirectory(gArgs.GetBlocksDirPath(), /*probeOnly=*/true);
}
bool AppInitLockDirectories()
@@ -1138,11 +1133,8 @@ bool AppInitLockDirectories()
// After daemonization get the directory locks again and hold on to them until exit
// This creates a slight window for a race condition to happen, however this condition is harmless: it
// will at most make us exit without printing a message to console.
- if (!LockDirectories(false)) {
- // Detailed error printed inside LockDirectory
- return false;
- }
- return true;
+ // Detailed error printed inside LockDirectory
+ return LockDirectory(gArgs.GetDataDirNet(), /*probeOnly=*/false);
}
bool AppInitInterfaces(NodeContext& node)
</details>