Skip to content

Commit bdc0a68

Browse files
committed
init: lock blocksdir in addition to datadir
This guards against 2 processes running with separate datadirs but the same blocksdir. It's not likely to happen currently, but may be more relevant in the future with applications using the kernel. Note that the kernel does not currently do any dir locking, but it should.
1 parent cabb2e5 commit bdc0a68

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/init.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1086,7 +1086,8 @@ static bool LockDirectory(const fs::path& dir, bool probeOnly)
10861086
}
10871087
static bool LockDirectories(bool probeOnly)
10881088
{
1089-
return LockDirectory(gArgs.GetDataDirNet(), probeOnly);
1089+
return LockDirectory(gArgs.GetDataDirNet(), probeOnly) && \
1090+
LockDirectory(gArgs.GetBlocksDirPath(), probeOnly);
10901091
}
10911092

10921093
bool AppInitSanityChecks(const kernel::Context& kernel)

0 commit comments

Comments
 (0)