At this point, I don’t see the benefit of this function anymore. Let’s just inline it?
0diff --git a/src/init.cpp b/src/init.cpp
1index 579669712e..3a984488af 100644
2--- a/src/init.cpp
3+++ b/src/init.cpp
4@@ -1107,12 +1107,6 @@ static bool LockDirectory(const fs::path& dir, bool probeOnly)
5 } // no default case, so the compiler can warn about missing cases
6 assert(false);
7 }
8-static bool LockDirectories(bool probeOnly)
9-{
10- // Only allow probing the blocks directory, the BlockManager takes the lock internally.
11- return LockDirectory(gArgs.GetDataDirNet(), probeOnly) &&
12- (probeOnly ? LockDirectory(gArgs.GetBlocksDirPath(), probeOnly) : true);
13-}
14
15 bool AppInitSanityChecks(const kernel::Context& kernel)
16 {
17@@ -1130,7 +1124,8 @@ bool AppInitSanityChecks(const kernel::Context& kernel)
18 // Probe the directory locks to give an early error message, if possible
19 // We cannot hold the directory locks here, as the forking for daemon() hasn't yet happened,
20 // and a fork will cause weird behavior to them.
21- return LockDirectories(true);
22+ return LockDirectory(gArgs.GetDataDirNet(), /*probeOnly=*/true)
23+ && LockDirectory(gArgs.GetBlocksDirPath(), /*probeOnly=*/true);
24 }
25
26 bool AppInitLockDirectories()
27@@ -1138,11 +1133,8 @@ bool AppInitLockDirectories()
28 // After daemonization get the directory locks again and hold on to them until exit
29 // This creates a slight window for a race condition to happen, however this condition is harmless: it
30 // will at most make us exit without printing a message to console.
31- if (!LockDirectories(false)) {
32- // Detailed error printed inside LockDirectory
33- return false;
34- }
35- return true;
36+ // Detailed error printed inside LockDirectory
37+ return LockDirectory(gArgs.GetDataDirNet(), /*probeOnly=*/false);
38 }
39
40 bool AppInitInterfaces(NodeContext& node)