This probably should’ve been included in #12653 when -blocksdir
was introduced. Credit TheCharlatan for noticing that it’s missing.
This guards against 2 processes running with separate datadirs but the same blocksdir. I didn’t add walletdir
as I assume sqlite has us covered there.
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.