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.
This commit is contained in:
Cory Fields 2025-01-15 19:11:33 +00:00
parent cabb2e5c24
commit bdc0a68e67

View file

@ -1086,7 +1086,8 @@ static bool LockDirectory(const fs::path& dir, bool probeOnly)
}
static bool LockDirectories(bool probeOnly)
{
return LockDirectory(gArgs.GetDataDirNet(), probeOnly);
return LockDirectory(gArgs.GetDataDirNet(), probeOnly) && \
LockDirectory(gArgs.GetBlocksDirPath(), probeOnly);
}
bool AppInitSanityChecks(const kernel::Context& kernel)